我正在尝试使用 tikz-3dplot 重现以下图像。
我需要有关矢量箭头、矢量 v 和单位矢量 i、j 和 k 所成角度的帮助。
以下是我目前所掌握的信息:
\documentclass{article}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{60}{110}
\begin{center}
\begin{tikzpicture}[>=latex,tdplot_main_coords,font=\footnotesize,scale=1.5]
\draw[thick,->] (0,0,0) -- (2,0,0) node[anchor=north east]{$x$};
\draw[thick,->] (0,0,0) -- (0,2,0) node[anchor=north west]{$y$};
\draw[thick,->] (0,0,0) -- (0,0,2) node[anchor=south]{$z$};
\draw[thick,->,color=red,opacity=0.5] (0,0,0) -- (2.5,2.5,3) node[ right] {$\vec{v}$};
\end{tikzpicture}
\end{center}
\end{document}
答案1
干得好:
\documentclass{article}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usetikzlibrary{arrows.meta,angles,quotes}
\begin{document}
\tdplotsetmaincoords{60}{110}
\begin{center}
\begin{tikzpicture}[>=latex,tdplot_main_coords,font=\footnotesize,scale=1.5]
\draw[thick,->] (0,0,0)coordinate (O) -- (3,0,0) coordinate (X)
node[anchor=north east]{$x$};
\draw[thick,->] (0,0,0) -- (0,3,0) coordinate (Y) node[anchor=north
west]{$y$};
\draw[thick,->] (0,0,0) -- (0,0,3) coordinate (Z) node[anchor=south]{$z$};
\draw[thick,->,color=red,opacity=0.5] (0,0,0) -- (2.5,2.5,3) coordinate (V)
node[ right] {$\vec{v}$};
\draw[dashed,magenta!50] (2.5,2.5,3) -- (2.5,2.5,0) -- (0,0,0);
\draw[very thick,red!80!black,-{Triangle[fill=white]}] (0,0,0) --
(2,0,0)node [right=1ex] {$\mathbf{i}$};
\draw[very thick,red!80!black,-{Triangle[fill=white]}] (0,0,0) --
(0,2,0)node [below] {$\mathbf{j}$};
\draw[very thick,red!80!black,-{Triangle[fill=white]}] (0,0,0) --
(0,0,2)node [left] {$\mathbf{k}$};
\path pic[draw, angle radius=5mm,"$\alpha$",angle
eccentricity=1,anchor=north east,inner sep=5pt] {angle
= X--O--V};
\path pic[draw, angle radius=7mm,"$\beta$",angle
eccentricity=1.3,] {angle
= Y--O--V};
\path pic[draw, angle radius=3mm,"$\gamma$",angle
eccentricity=1.5] {angle
= V--O--Z};
\end{tikzpicture}
\end{center}
\end{document}
如果您想要i
j
k
黑色,请添加text=black
到节点选项。