答案1
圆弧上有弯曲箭头的版本。
\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{amsmath}
\DeclareMathOperator{\re}{Re}
\DeclareMathOperator{\im}{Im}
\usetikzlibrary{arrows.meta,bending,decorations.markings,intersections} %< added
\tikzset{% inspired by https://tex.stackexchange.com/a/316050/121799
arc arrow/.style args={%
to pos #1 with length #2}{
decoration={
markings,
mark=at position 0 with {\pgfextra{%
\pgfmathsetmacro{\tmpArrowTime}{#2/(\pgfdecoratedpathlength)}
\xdef\tmpArrowTime{\tmpArrowTime}}},
mark=at position {#1-\tmpArrowTime} with {\coordinate(@1);},
mark=at position {#1-2*\tmpArrowTime/3} with {\coordinate(@2);},
mark=at position {#1-\tmpArrowTime/3} with {\coordinate(@3);},
mark=at position {#1} with {\coordinate(@4);
\draw[-{Stealth[length=#2,bend]}]
(@1) .. controls (@2) and (@3) .. (@4);},
},
postaction=decorate,
}
}
\begin{document}
\begin{tikzpicture}
\draw[-latex] (0,-5) -- (0,5) node[left]{$\im z$};
\draw[-latex] (-1,0) -- (5,0) node[right]{$\re z$};
\draw[red,arc arrow=to pos 0.7 with length 3mm]
(0,-3) node[left,blue]{$-\mathrm{i}R$} arc (-90:90:3)
node[left,blue]{$\mathrm{i}R$};
\draw[red,arc arrow=to pos 0.7 with length 2mm] (0,1.5) arc (90:-90:0.5);
\draw[red,arc arrow=to pos 0.7 with length 2mm] (0,-0.5) arc (90:-90:0.5);
\node[circle,draw,fill,scale=0.3,label=left:{$\mathrm{i}\omega$}] at (0,1){};
\node[circle,draw,fill,scale=0.3,label=left:{$-\mathrm{i}\omega$}] at (0,-1){};
\foreach \X in {2.1,0.2,-2}
{\draw[-{Stealth[length=2mm]},red] (0,\X) --++(0,-0.2);}
\end{tikzpicture}
\end{document}
然而,如果整个轮廓是红色的话我会觉得更有说服力。
\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{amsmath}
\DeclareMathOperator{\re}{Re}
\DeclareMathOperator{\im}{Im}
\usetikzlibrary{arrows.meta,bending,decorations.markings,intersections} %< added
\tikzset{% inspired by https://tex.stackexchange.com/a/316050/121799
arc arrow/.style args={%
to pos #1 with length #2}{
decoration={
markings,
mark=at position 0 with {\pgfextra{%
\pgfmathsetmacro{\tmpArrowTime}{#2/(\pgfdecoratedpathlength)}
\xdef\tmpArrowTime{\tmpArrowTime}}},
mark=at position {#1-\tmpArrowTime} with {\coordinate(@1);},
mark=at position {#1-2*\tmpArrowTime/3} with {\coordinate(@2);},
mark=at position {#1-\tmpArrowTime/3} with {\coordinate(@3);},
mark=at position {#1} with {\coordinate(@4);
\draw[-{Stealth[length=#2,bend]}]
(@1) .. controls (@2) and (@3) .. (@4);},
},
postaction=decorate,
}
}
\begin{document}
\begin{tikzpicture}
\draw[-latex] (0,-5) -- (0,5) node[left]{$\im z$};
\draw[-latex] (-1,0) -- (5,0) node[right]{$\re z$};
\node[circle,draw,fill,scale=0.3,label=left:{$\mathrm{i}\omega$}] at (0,1){};
\node[circle,draw,fill,scale=0.3,label=left:{$-\mathrm{i}\omega$}] at (0,-1){};
\begin{scope}[red,thick]
\draw[arc arrow=to pos 0.7 with length 3mm]
(0,-3) node[left,blue]{$-\mathrm{i}R$} arc (-90:90:3)
node[left,blue]{$\mathrm{i}R$};
\draw[arc arrow=to pos 0.7 with length 2mm] (0,{3cm+0.5*\pgflinewidth}) --
(0,{1.5cm-0.5*\pgflinewidth});
\draw[arc arrow=to pos 0.7 with length 2mm] (0,1.5) arc (90:-90:0.5);
\draw[arc arrow=to pos 0.7 with length 2mm] (0,-0.5) arc (90:-90:0.5);
\draw[arc arrow=to pos 0.45 with length 2mm] (0,{0.5cm+0.5*\pgflinewidth}) --
(0,{-0.5cm-0.5*\pgflinewidth});;
\draw[arc arrow=to pos 0.45 with length 2mm] (0,{-1.5cm+0.5*\pgflinewidth}) --
(0,{-3cm-0.5*\pgflinewidth});
\end{scope}
\end{tikzpicture}
\end{document}
编辑:由于某种原因,尽管 pdf 很好,但是输出看起来很糟糕。
答案2
我曾写过一个小图书馆避免路径这有助于做到这一点:
\documentclass[border=7mm]{standalone}
\usepackage{mathtools}
\usepackage{tikz}
\usetikzlibrary{avoidpath} % <--- https://github.com/kpym/tikz-avoidpath
\begin{document}
\begin{tikzpicture}[thick]
% axes and points
\draw
(-1,0) edge[-latex] node[at end,right]{$\operatorname{Re} z$} (4,0)
(0,-4) edge[-latex] node[at end,right]{$\operatorname{Im} z$} (0,4)
(0,1) node[scale=3](i){.} node[left]{$i$}
(0,-1) node[scale=3](-i){.} node[left]{$-i$}
(0,3) coordinate(iR) node[blue,left]{$iR$}
(0,-3) coordinate(-iR) node[blue,left]{$-iR$}
;
% the path
\draw[red, with arrows=28mm]
(0,0)
to[avoid={pole={(-i)}, radius=3mm}]
(-iR)
arc(-90:90:3)
to[avoid={pole={(i)}, radius=3mm}]
cycle;
\end{tikzpicture}
\end{document}