7

I like to reproduce the following image from an 1957 aviation report in tikz pgfplots. It is fairly complicated and I'm not sure how to approach it. Nodes and positioning is too much a hassle / requires find tuning and I don't see where I can use chains.

So thoughts and attempts?

enter image description here

One starting point is to use coordinates and the angles tikzlibrary. However the above figure has a lot of points and that just I don't think setting absolute coordinates is a good approach.

\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{quotes,angles}
\begin{document}
\begin{tikzpicture}
  \draw
    (3,-1) coordinate (a) node[right] {a}
    -- (0,0) coordinate (b) node[left] {b}
    -- (2,2) coordinate (c) node[above right] {c}
    pic["$\alpha$", draw=orange, <->, angle eccentricity=1.2, angle radius=1cm]
    {angle=a--b--c};
\end{tikzpicture}
\end{document}
Elpezmuerto
  • 1,039
  • 2
    I'm not going to be able to answer this tonight (or this weekend even), but a question will arise: are you particularly attached to the 'multiple arrows' bit, or would one labelled arrow going from node to node suffice? Even so, a MWE would be nice :) As it stands, you're at the mercy of our procrastination team. – Sean Allred Oct 04 '14 at 03:00
  • @SeanAllred: TeX is no procrastination, it's a philosophy ;-) –  Oct 04 '14 at 03:02
  • @SeanAllred, I agree on the MWE is nice but I'm trying to brainstorm where to just start. tikz-pgfplots has lots of options and I hate to get bogged down on an inelegant solution. And no, I am not attached to the multiple arrows. I am more concerned with getting the layout / geometry correct. I can play around with the arrow / line style. – Elpezmuerto Oct 04 '14 at 03:36
  • For questions like these, sometimes an MWE can be as simple as drawing an arrow from one node to another. It's just meant to show research effort :) – Sean Allred Oct 04 '14 at 03:38
  • @SeanAllred I threw up a MWE using coordinates and the angles tikzlibrary but I think that approach is too much of a hassle because that is a lot of points to define. There must be a more elegant way? – Elpezmuerto Oct 04 '14 at 03:39

2 Answers2

13

Illustrating the "multiple arrows" requirement by exploiting the show path construction decoration and the calc library:

\documentclass[tikz, border=5]{standalone}
\usetikzlibrary{decorations.pathreplacing,calc,arrows.meta,angles,quotes}
\tikzset{%
  multi arrows/.style args={#1 with #2 sep}{
    decoration={show path construction, 
      lineto code={
        \foreach \i [count=\j from 0] in {1,...,#1}
          \draw let \p1=(\tikzinputsegmentfirst),\p2=(\tikzinputsegmentlast),
            \n1={veclen(\x2-\x1,\y2-\y1)},
            \n2={(\n1-#2*(#1-1))/#1},
            \n3={\n2+#2} in [every multi arrow/.try] 
            ($(\tikzinputsegmentfirst)!\n3*\j!(\tikzinputsegmentlast)$) --
            ($(\tikzinputsegmentfirst)!\n3*\j+\n2!(\tikzinputsegmentlast)$);
      }
    },
    decorate
  },
  every multi arrow/.style={
     thick, draw, ->
  }
}
\begin{document}

\begin{tikzpicture}
[
  >=Triangle,
  marking/.style={%
    fill=white,
    midway
  }
]

\path 
  (0:0)   coordinate (O)  node [anchor=225] {$O$}
  (135:3) coordinate (A1) node [anchor=-45] {$A_1$}
  (240:5) coordinate (A2) node [anchor=80]  {$A_2$}
  (280:3) coordinate (o)
 +(150:4) coordinate (a)  
 +( 60:6) coordinate (c)  
  ($(o)!0.9!(a)$) coordinate (p1) node [anchor=0] {$p_1$}
 +(250:2)         coordinate (v1) 
  ($(o)!0.3!(c)$) coordinate (p2) 
 +( 20:2)         coordinate (v2)
  ($(o)!0.9!(c)$) coordinate (-v1);

\draw [dashed] (a) -- (o) -- (c);
\path pic ["$90^\circ$", draw, <->, angle eccentricity=1.25, angle radius=0.75cm]
    {angle=c--o--a};

\draw [multi arrows=3 with 5pt sep] (A1) -- (O);
\draw [multi arrows=5 with 5pt sep] (A2) -- (O);
\draw [multi arrows=1 with 0pt sep] 
  (O) -- (p1) node [marking] {$p_1$}
      -- (v1) node [marking] {$v_1$};
\draw [multi arrows=1 with 0pt sep] 
  (O) -- (p2)  node [marking] {$p_2$} 
      -- (v2)  node [marking] {$v_2$}
      -- (-v1) node [marking] {$-v_1$};
\end{tikzpicture}

\end{document}

enter image description here

Mark Wibrow
  • 70,437
10

This is one possible solution.

enter image description here

Code

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{quotes,angles,shapes,arrows,positioning,}
\begin{document}
    \tikzset{>=triangle 45}
\begin{tikzpicture}
  \draw[dashed]
       (-3,3) coordinate (a) node[right] {a}
    -- coordinate[pos=0.2,left](p1) (0,0) coordinate (b) node [left] {}
    -- coordinate[pos=0.3,right](p2)
 (5,5) coordinate (c) node [above right] {c}
    pic["$90^\circ$", draw=orange, <->, angle eccentricity=1.2, angle radius=1cm]
    {angle=c--b--a};


\coordinate (O) at (-0.5,3);
\draw[->] (O)node[above right](){O} --node[fill=white,pos=0.5](){$p_1$}(p1) node[left](){$p_1$} ;
\draw[->] (p1)--node[fill=white,pos=0.5](){$v_1$}(-4,0);
\draw[->] (O) --node[fill=white,pos=0.5](){$p_2$}(p2);
\draw[->] (p2)--node[fill=white,pos=0.5](){$v_2$} ++(2,1)coordinate (a);
\draw[->] (a) --node[fill=white,pos=0.3](){$-v_1$} (4.7,4.7);

% Approaching routes
\node at (-3,6)(a1){$A_1$}; % change the coordinates for different incoming direction
\path[->] (a1)--node[pos=0.3](a2){} node[pos=0.6](a3){} node[pos=0.9](a4){}(O);
\draw[->] (a1)--(a2);
\draw[->] (a2)--(a3);
\draw[->] (a3)--(O);

\node at (-2,-4) (b1){$A_2$}; % change the coordinates for different incoming direction
\path[->](b1)--node[pos=0.1](b2){} node[pos=0.3](b3){} node[pos=0.5](b4){} node[pos=0.7](b5){} node[pos=0.9](b6){}(O);
\foreach \i/\j in {1/2,2/3,3/4,4/5,5/6}{
\draw[->] (b\i) --(b\j);
}
\draw[->] (b6) -- (O);

\end{tikzpicture}
\end{document}
Jesse
  • 29,686