我想从一条直线到一条曲线绘制平行箭头(例如 10 个箭头)。将直线和曲线分成 10 个部分然后将它们连接在一起并不是一个好主意,因为从数学上讲,得到的箭头不是平行的。
我所做的如下。
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows,positioning}
\begin{document}
\begin{tikzpicture}[allow upside down]
\draw (0,0) circle (3.5);
\draw (0,3.5) arc (90:-90:1.75 and 3.5) \foreach \p in {0,5,...,100} {
node[inner sep=0cm,above,pos=\p*0.01,
anchor=center,
minimum height=\p*0.03cm,minimum width=(10+\p)*0.3cm]
(N \p){}
};
\draw (0,3.5) --(0,-3.5) \foreach \p in {0,5,...,100} {
node[inner sep=0cm,above,pos=\p*0.01,
anchor=center,
minimum height=\p*0.03cm, minimum width=(10+\p)*0.3cm]
(M \p){a}
};
\foreach \p in {5,10,15,...,95} {
\draw[-latex,blue] (N \p.center) -| (0,0);
}
\end{tikzpicture}
\end{document}
答案1
我真的不知道我是否理解你想要什么,但对你的代码稍加修改就会产生“从直线到曲线的平行箭头”。
\documentclass[tikz,border=3.14mm]{standalone}
\begin{document}
\begin{tikzpicture}[allow upside down]
\draw (0,0) circle (3.5);
\draw (0,3.5) arc (90:-90:1.75 and 3.5) \foreach \p in {0,5,...,100} {
node[inner sep=0cm,above,pos=\p*0.01,
anchor=center,
minimum height=\p*0.03cm,minimum width=(10+\p)*0.3cm]
(N \p){}
};
\draw (0,3.5) -- (0,-3.5);
\foreach \p in {5,10,15,...,95} {
\draw[latex-,blue] (N \p.center) -- (0,0 |- N \p.center);
}
\end{tikzpicture}
\end{document}
附录:要反转箭头,只需替换\draw[latex-,blue]...
但\draw[-latex,blue]
。但是,要使距离相等,需要稍微多一点努力
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{intersections}
\begin{document}
\begin{tikzpicture}[allow upside down]
\draw (0,0) circle (3.5);
\draw[name path=arc] (0,3.5) arc (90:-90:1.75 and 3.5);
\draw (0,3.5) -- (0,-3.5);
\foreach \p in {-3.25,-3,...,3.25} {
\path[name path=line] (0,\p) -- (3,\p);
\draw[latex-,blue,name intersections={of=line and arc}]
(0,\p) -- (intersection-1);
}
\end{tikzpicture}
\end{document}
在这种情况下,你不需要交叉点,你可以只使用
\documentclass[tikz,border=3.14mm]{standalone}
\begin{document}
\begin{tikzpicture}[allow upside down]
\draw (0,0) circle (3.5);
\draw (0,3.5) arc (90:-90:1.75 and 3.5);
\draw (0,3.5) -- (0,-3.5);
\clip (0,3.5) arc (90:-90:1.75 and 3.5) -- cycle;
\foreach \p in {-3.25,-3,...,3.25} {
\draw[latex-,blue]
(0,\p) -- (3,\p);
}
\end{tikzpicture}
\end{document}
答案2
PSTricks 解决方案仅用于娱乐目的。
\documentclass[pstricks]{standalone}
\usepackage{pst-plot}
\begin{document}
\begin{pspicture}[algebraic](-4,-4)(4,4)
\pscircle{3}\psline(0,-3)(0,3)
\psellipticarc(0,0)(1,3){-90}{90}
\curvepnodes[plotpoints=20]{-3}{3}{sqrt(1-(t/3)^2)|t}{A}
\foreach \i in {1,...,\numexpr\Anodecount-1}{\pcline[nodesepB=.4pt]{<-}(0,0|A\i)(A\i)}
\end{pspicture}
\end{document}