2

I'm struggling at drawing some figures using tikz package, i've succeeded drawing the three main linse that meet at the point A, however i'm struggling drawing the two small arrows, can someone help me please ?

Here is what i wanna draw :

enter image description here

Here is what i succeeded drawing : enter image description here

Don't worry about the x and the o i know how to draw them, it's the small arrows that are giving me hard time here is my code :

\begin{tikzpicture}
    \draw (4,0) -- (4,2);
        \draw (4,0) -- (6,-2);              
        \draw (4,0) -- (2,-2);                                              
\end{tikzpicture}

Thanks in advance

6

Based on Alain Matthes answer here, you can do it like

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}

\begin{document}
    \tikzset{->-/.style={decoration={
                markings,
                mark=at position #1 with {\arrow{>}}},postaction={decorate}}}
    \begin{tikzpicture}
        \draw (4,0) -- (4,2);
        \draw[->-=.5] (4,0) -- (6,-2);              
        \draw[->-=.5] (2,-2) -- (4,0);                                              
    \end{tikzpicture}
\end{document}
  • I can't thank you enough you know that right ?! i've been trying to reach for a solution for two days thank you thank you and thank you again sir ! – Ali Az Apr 5 '18 at 14:38
1

Or without using the decoration

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc, positioning}
\begin{document}
    \begin{tikzpicture}
        \coordinate (A) at (4,0);
        \draw (A) -- (4,2);
        \draw (2,-2) -- (A) node [sloped, pos=.5] {>} -- (6,-2) node [sloped, pos=.5] {>};                                             
        \fill (A) circle [radius=2pt];
        \node [right=3pt of A] {$A$};
        \node [below=3ex of A] {\large$X$};
        \node [above left=3ex of A] {\large$O$};
        \node [above right=3ex of A] {\large$O$};
    \end{tikzpicture}
\end{document}
  • Did you accept my answer because I also placed the nodes? IMHO Christoph90's one is far more elegant (see upvotes)! – NBur Apr 5 '18 at 15:25
  • I wanted to accept both codes but i realized it wasn't possible because both your codes work and make exactly what i wanted thank you both Nbur and Christoph90's – Ali Az Apr 7 '18 at 13:28
0

Also, very straightforward with pstricks-add package. Compile with xelatex.

\documentclass[12pt]{article}
\usepackage{pstricks-add}
\begin{document}

\begin{pspicture}
  \psset{arrowsize=4pt 3}
  \psline {*-}(4,0)(4,2)
  \psline [ArrowInside=->,ArrowInsidePos=0.5](2,-2)(4,0)(6,-2) 
  \uput{07pt}[0](4,0){$A$} 
  \uput{20pt}[45](4,0){$O$} 
  \uput{20pt}[135](4,0){$O$} 
  \uput{20pt}[-90](4,0){$X$} 
\end{pspicture}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.