绘制不同方向的简单箭头

绘制不同方向的简单箭头

我想勾勒出这个图形。如果您能指导我画出一个带有方向的箭头,我将不胜感激。

一些有向箭头

答案1

您可以使用tikz包和arrowsdecorations来实现与您的绘图类似的效果。

\documentclass[tikz]{standalone}
\usetikzlibrary{arrows,decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}[
  >=stealth',
  pos=.8,
  photon/.style={decorate,decoration={snake,post length=1mm}}
]
  \draw[gray,thick] (-2,0) -- (2,0);
  \draw[->] (135:2) -- node[below left,pos=.2] {$P$} (0,0);
  \draw[->] (0,0) -- node[below right] {$P$} (45:2);
  \draw[->] (0,0) -- node[above right] {$P$} (-45:2);
  \draw[->,photon] (0,0) -- node[above left] {$SV$} (60:2);
  \draw[->,photon] (0,0) -- node[below left] {$SV$} (-60:2);
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

这是一个起点。首先定义蛇形线的样式(此处为 LL)。然后通过以下方式绘制一条线

\draw[options] (x1,y1) --(x2,y2)node[position]{label};       % Euclid coordi
\draw[options] (0,0) --(alpha:radius)node[position]{label};  % polar coordi

选项:粗、非常粗、颜色、箭头类型、...、LL]

在此处输入图片描述

代码

\documentclass[10pt,a4paper]{standalone}

\usepackage{tikz}
\usetikzlibrary{positioning,decorations.pathmorphing}

\tikzset{
LL/.style={
  draw=black,decorate,
  decoration={snake, segment length=3mm, amplitude=1mm,post length=2mm}
  }
}  

\begin{document}

\begin{tikzpicture}

\draw[very thick] (-2,0) --(2,0);
\path[LL,thick,->,>=latex]      (0,0) -- (1,1) node[above]{SV};
\draw[LL,->,>=latex,thick,black](0,0) -- (1,-1)node[below]{SV};
\draw[->,>=latex,thick,black]   (-1,1) --(0,0) node[below]{P};

\draw[->,>=latex,thick,black] (0,0) -- (25:2)  node[below]{P};
\draw[->,>=latex,thick,black] (0,0) -- (-25:2) node[below]{P};
\end{tikzpicture}

\end{document}

答案3

这是一个元帖子方法。

在此处输入图片描述

普通 MP 中没有定义路径变形“装饰”,因此我提供了一个名为的函数,sinuous该函数返回给定路径的正弦波副本。它也应该适用于弯曲路径。

prologues := 3;
outputtemplate := "%j%c.eps";

s_lambda = 6; % the length of the waves
s_amplitude = 2; % their height

vardef sinuous expr p = 
  save psc;
  path psc; 
  psc = ((-2.74, -0.390885) for x=-2.64 step .1 until 2.74: -- (x,sind(57.29578x)) endfor) xscaled 0.159155 s_lambda yscaled s_amplitude ;
  point 0 of p { direction 0 of p } 
    for i=2 upto -2+floor(arclength p/s_lambda):
      .. psc rotated angle direction (arctime i*s_lambda of p) of p 
             shifted           point (arctime i*s_lambda of p) of p 
    endfor
  .. {direction infinity of p} point infinity of p
  enddef;

beginfig(1);

z1 = -z2 = 80 right;
z3 = z1 rotated 45;
z4 = z1 rotated 80;
z5 = z1 rotated 140;
z6 = z1 rotated -20;
z7 = z1 rotated -40;

draw z1--z2 withpen pencircle scaled 2 withcolor .7 white;

drawarrow z5 -- origin cutafter fullcircle scaled 4bp;
drawarrow origin -- z3;
drawarrow origin -- z6;

drawarrow sinuous origin -- z4;
drawarrow sinuous origin -- z7;

fill fullcircle scaled 3 withcolor .67 red;

label.rt (btex $P$ etex, z3);
label.lft(btex $P$ etex, z5);
label.rt (btex $P$ etex, z6);
label.lft(btex $SV$ etex, z4);
label.bot(btex $SV$ etex, z7);

endfig;
end.

相关内容