到目前為止,我的程式碼如下:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,decorations.markings}
\begin{document}
\begin{tikzpicture}[scale=2]
% axes
\draw [->] (0,-1) --(0,1.5) node [left] {$\mathrm{Im}(p)$};
\draw [->] (-2,0) --(2,0) node [below] {$\mathrm{Re}(p)$};
% pole
\foreach \i/\j in {-0.3/c}{\node[circle, inner sep=1pt] (\j) at (0.9,\i) {$\times$};}
% line
\draw [thick] (-1.5,0) --(0.8,0);
\draw [thick] (1,0) --(1.5,0);
% C - bromwich contour
\node at (-1.2,0) [below right] {$C$};
% mathmode
\draw[<-,shorten <=2mm] (1,-0.3)-- ++ (-20:0.5) node[right] {$v_z=\frac{\mathrm{i}p}{k}$};
% vertical lines
\draw [thick] (0.8,0) -- (0.8,-0.1);
\draw [thick] (1,0) -- (1,-0.1);
% semi circle
\draw (1,-0.1) arc[radius=2mm, start angle=20, end angle=-250];
\end{tikzpicture}
\end{document}
我的問題是如何繪製圍繞桿的弧線。我已經嘗試了很多次使用該命令弧但我沒能製作出類似的圖片。
所以,我想知道是否有更有效的方法來完成這種弧/曲線。
先感謝您。
答案1
圓圈上的箭頭不正確,我不知道我是否可以考慮這個解決方案高效率的但它可以作為起點。
此程式碼使用cross out
極點的形狀。每個極點上都繪製了一個不可見的圓形節點。此節點用作在兩個片段中繪製的環繞弧的參考。
\documentclass[border=2mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc, decorations.markings, shapes.misc}
\begin{document}
\begin{tikzpicture}[scale=2,
pole/.style={cross out, draw=black, minimum size=2mm}
]
% axes
\draw [->] (0,-1) --(0,1.5) node [left] {$\mathrm{Im}(p)$};
\draw [->] (-2,0) --(2,0) node [below] {$\mathrm{Re}(p)$};
% pole
\node[pole] (c) at (0.9,-.3) {};
\node[circle, minimum size=6mm] (aux) at (c) {};
% line
\draw [ultra thick,
blue,
decoration={markings,
mark=at position .05 with {\arrowreversed{stealth}},
mark=at position .40 with {\arrowreversed{stealth}},
mark=at position .75 with {\arrowreversed{stealth}}},
postaction={decorate}]
(aux.-90) arc(-90:-250:1.5mm)|- (-1.5,0);
\draw [ultra thick,
red,
decoration={markings,
mark=at position .3 with {\arrow{stealth}},
mark=at position .80 with {\arrow{stealth}}},
postaction={decorate}]
(aux.-90) arc(-90:70:1.5mm)|- (1.5,0);
% C - bromwich contour
\node at (-1.2,0) [below right] {$C$};
% mathmode
\draw[<-,shorten <=2mm] (1,-0.3)-- ++ (-20:0.5) node[right] {$v_z=\frac{\mathrm{i}p}{k}$};
\end{tikzpicture}
\end{document}
答案2
這是另一種努力梅塔普斯特包裹在luamplib
圖書館.編譯用lualatex
.
\RequirePackage{luatex85}
\documentclass[border=5mm]{standalone}
\usepackage{luamplib}
\begin{document}
\mplibtextextlabel{enable}
\begin{mplibcode}
beginfig(1);
numeric u; % unit size
u = 1cm;
path xx, yy; % axes and labels
xx = (3 left -- 6 right) scaled u;
yy = (2 down -- 2 up) scaled u;
draw xx withcolor .7 white;
draw yy withcolor .7 white;
label.bot("$\Re\{v_1\}$", point 1 of xx);
label.lft("$\Im\{v_2\}$", point 1 of yy);
% position the pole
z1 = (2.7u,-1u);
% label it with a cross
label("$\times$",z1);
% parameters for the pole marker
numeric gap, radius;
gap = 1/8 u;
radius = 1/3 u;
path arc, cc;
% the arc is most of a circle drawn round the pole
arc = fullcircle rotated 90 % rotate it so point 0 is at top
scaled 2 radius % scale it
shifted z1 % move it to the pole
cutbefore yy shifted (x1-gap,0) % cut off the beginning
cutafter yy shifted (x1+gap,0); % and the end
% join the arc up with some straight segments to make the contour
cc = (-2u,0) -- (x1-gap, 0) -- arc -- (x1+gap,0) -- (5u,0);
% set some drawing options for the arrows
interim linecap := 0; % sharp ends
interim linejoin := 0; % sharp joins & arrowhead
drawoptions(withpen pencircle scaled 3/2 withcolor 2/3 red);
% how many subarrow to show
subarrows = 4;
% draw subarrows along cc
arrowlength = arclength(cc)/subarrows;
numeric a,b;
for i = 1 upto subarrows:
a := arctime (i-1)*arrowlength of cc;
b := arctime i*arrowlength of cc;
drawarrow subpath (a,b) of cc;
endfor
drawoptions();
endfig;
\end{mplibcode}
\end{document}