答案1
这是一个 TikZ 方法,它使用angles
和quotes
库根据三个坐标自动绘制角度,基于这个答案。
\documentclass[tikz,border=3pt]{standalone}
\usetikzlibrary{quotes,angles}
\begin{document}
\begin{tikzpicture}[line cap=rect]
\coordinate (Origin) at (0,0);
\draw [->,blue] (Origin)--++(30:2) coordinate (VecV) node[midway,auto,swap] {$\vec{v}$};
\draw [->,red] (Origin)--++(110:2) coordinate (VecU) node[midway,auto] {$\vec{u}$};
\draw pic["$\theta$", draw=orange, text=orange, <->, angle eccentricity=1.25, angle radius=1cm]
{angle=VecV--Origin--VecU};
\end{tikzpicture}
\end{document}
还有一个动画版,只是为了好玩……
\documentclass[tikz,border=3pt]{standalone}
\usetikzlibrary{quotes,angles}
\begin{document}
\foreach \X in {-180,-170,...,90,80,70,...,-180}{
\begin{tikzpicture}[line cap=rect]
\path[use as bounding box] (-2.2,-2.2) rectangle (2.2,2);
\coordinate (Origin) at (0,0);
\draw [->,blue] (Origin)--++(\X:2) coordinate (VecV);
\path (Origin)--++(\X-15:1) coordinate (VecVLabel);
\node [blue] at (VecVLabel) {$\vec{v}$};
\draw [->,red] (Origin)--++(110:2) coordinate (VecU) node[midway,auto] {$\vec{u}$};
\draw pic["$\theta$", draw=orange, text=orange, <->, angle eccentricity=1.25, angle radius=1cm] {angle=VecV--Origin--VecU};
\end{tikzpicture}
}
\end{document}