有没有什么办法可以写出弯曲的箭头?

有没有什么办法可以写出弯曲的箭头?

我想沿线写一个弯曲的箭头,就像这个一样。我该如何写呢?在此处输入图片描述

答案1

绘制箭头的方法有很多种。例如直接使用\pdfliteral图元:

x%
\leavevmode\hbox to6pt{%
   \pdfliteral{q 1 J .35 0 0 .35 -2 -2 cm
      10 0 m 20 10 20 20 10 30 c S 10 30 m 13 20 l 19 24 l h B Q}\hss}

\bye

答案2

试试这个代码:

\documentclass[tikz]{standalone}
\def\centerarc[#1](#2)(#3:#4:#5);%
% #1 : options for drawing
% #2 : center of arc
% #3 : start angle for arc
% #4 : end angle for arc
% #5 : radius of arc
{

    \draw[#1]([shift=(#3:#5)]#2) arc (#3:#4:#5);
}
\begin{document}
\begin{tikzpicture}
    \draw[gray!20] (0,0) grid (3,3);% comment if not needed
    \draw (1,1)--(2,2);% comment if not needed
    \draw (1,2)--(2,1);% comment if not needed
    \centerarc[cyan,line width=1pt,-latex](1,1.5)(-26.565:26.565:1.118cm);
\end{tikzpicture}   
    
\end{document}

输出:

在此处输入图片描述

这张图片中的代码有更多帮助:

在此处输入图片描述

编辑:其他例子。代码:

\documentclass[tikz]{standalone}
\def\centerarc[#1](#2)(#3:#4:#5);%
% #1 : options for drawing
% #2 : center of arc
% #3 : start angle for arc
% #4 : end angle for arc
% #5 : radius of arc
{

    \draw[#1]([shift=(#3:#5)]#2) arc (#3:#4:#5);
}
\begin{document}
\begin{tikzpicture}
    \draw[gray!20] (0,0) grid (3,3);% comment if not needed
    %\draw (1,1)--(2,2);% comment if not needed
    %\draw (1,2)--(2,1);% comment if not needed
    \filldraw[cyan] (1,1.5) circle(1pt);
    \draw[cyan,dotted] (2,2)--(1,1.5)--(2,1);
    \centerarc[cyan,line width=1pt,-latex](1,1.5)(-26.565:26.565:1.118cm);
    \filldraw[magenta] (0,1) circle(1pt);
    \draw[magenta,dotted] (1,0)--(0,1)--(1,2);
    \centerarc[magenta,line width=1pt,-latex](0,1)(-45:45:1.412);
    \filldraw[green] (1,0) circle(1pt);
    \draw[green,dotted] (3,1)--(1,0)--(0,2);
    \centerarc[green,line width=1pt,-latex](1,0)(26.565:116.565:2.236);
\end{tikzpicture}   
    
\end{document}

输出:

在此处输入图片描述

相关内容