答案1
使用pgfplots
选项 ,您可以绘制一个矢量场quiver
。此选项创建一个 3d 矢量场,但您可以选择从上方查看它,方法是将 添加view={0}{90}
到axis
选项中。
像这样:
\documentclass[border=2mm]{standalone}
\usepackage {pgfplots}
\pgfplotsset{compat=1.17}
\begin{document}
\begin{tikzpicture}
\begin{axis}[%
view = {0}{90}, % for a view 'from above'
domain = -3:3,
y domain = -3:3,
xtick = {-3,...,3},
ytick = {-3,...,3},
]
\addplot3[blue, quiver={u=8*x, v=2*y, scale arrows=0.05}, samples=16, -latex] (x,y,0);
\addplot3[red, thick, domain=0:360, samples=41] ({0.5*sqrt(5)*cos(x)},{sqrt(5)*sin(x)},0);
\end{axis}
\end{tikzpicture}
\end{document}