
答案1
歡迎!像這樣的東西嗎?
\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}[declare function={gauss(\x)=exp(-pow(\x/10,2));},>=stealth]
\begin{axis}[hide axis,xmin=-1,xmax=1,ymin=0,ymax=1]
\pgfmathsetmacro{\myangle}{0}
\draw[->] (0,0) -- (90:1);
\pgfplotsinvokeforeach{0,...,10}{
\pgfmathsetmacro{\myangle}{\myangle+1/(gauss(\myangle))}
\edef\temp{\noexpand\draw[->] (0,0) -- (90+\myangle:1);
\noexpand\draw[->] (0,0) -- (90-\myangle:1);}
\temp
}
\end{axis}
\end{tikzpicture}
\end{document}
或用極軸。
\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepgfplotslibrary{polar}
\begin{document}
\begin{tikzpicture}[declare function={gauss(\x)=exp(-pow(\x/10,2));},>=stealth]
\begin{polaraxis}[ymax=1,xmin=0,xmax=180,ytick=\empty]
\pgfmathsetmacro{\myangle}{0}
\draw[->] (0,0) -- (90,1);
\pgfplotsinvokeforeach{0,...,10}{
\pgfmathsetmacro{\myangle}{\myangle+1/(gauss(\myangle))}
\edef\temp{\noexpand\draw[->] (0,0) -- (90+\myangle,1);
\noexpand\draw[->] (0,0) -- (90-\myangle,1);}
\temp
}
\end{polaraxis}
\end{tikzpicture}
\end{document}