复杂的 tikz 矢量图(转弯产生的近似误差距离)

复杂的 tikz 矢量图(转弯产生的近似误差距离)

我喜欢复制以下图片1957 年航空报告在 tikz pgfplots 中。这相当复杂,我不确定如何处理它。节点和定位太麻烦/需要查找调整,我不知道在哪里可以使用链。

那么有想法和尝试吗?

在此处输入图片描述

一个起点是使用坐标和角度 tikzlibrary。但是上图有很多点,所以我认为设置绝对坐标不是一个好方法。

\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}

答案1

show path construction通过利用装饰和库来说明“多箭头”要求calc

\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}

在此处输入图片描述

答案2

这是一个可能的解决方案。

在此处输入图片描述

代码

\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}

相关内容