如何使用 tikzpicture 在 xy 平面上繪製 3d 圓弧?

如何使用 tikzpicture 在 xy 平面上繪製 3d 圓弧?

所以我試圖從 x 軸到 y 軸繪製一條弧線來簡化 r 和 p 之間的叉積,並且我使用下面的程式碼,但正如你所看到的,它並沒有給出我所需要的弧線我願意。我該怎麼做?

\begin{tikzpicture}
\draw (0,0,0) node[above left] {};
\draw[thick, ->] (0,0,0) -- (2,0,0) node[anchor=north west]{$y$};
\draw[thick, ->] (0,0,0) -- (0,2,0) node[anchor=south west]{$z$};
\draw[thick, ->] (0,0,0) -- (0,0,2) node[anchor=south east]{$x$};

\draw[thick, ->,green] (0,0,0) -- (1,0,0) node[anchor=north east]
{$\vec{p}$};
\draw[thick, ->,red] (0,0,0) -- (0,1,0) node[anchor=north west]{$\vec{L}$};
\draw[thick, ->,blue] (0,0,0) -- (0,0,1) node[anchor=south east]{$\vec{r}$};
\draw[->] (0,0,0.5) arc (0:90:0.5cm);
\end{tikzpicture}

這是圖片:

在此輸入影像描述

答案1

一種方法是載入 tikz-3dplot 套件。

\documentclass[tikz]{standalone}
\usepackage{tikz-3dplot}
\begin{document}
\begin{tikzpicture}
\tdplotsetmaincoords{70}{110}
\draw (0,0,0) node[above left] {};
\draw[thick, ->] (0,0,0) -- (2,0,0) node[anchor=north west]{$y$};
\draw[thick, ->] (0,0,0) -- (0,2,0) node[anchor=south west]{$z$};
\draw[thick, ->] (0,0,0) -- (0,0,2) node[anchor=south east]{$x$};

\draw[thick, ->,green] (0,0,0) -- (1,0,0) node[anchor=north east]
{$\vec{p}$};
\draw[thick, ->,red] (0,0,0) -- (0,1,0) node[anchor=north west]{$\vec{L}$};
\draw[thick, ->,blue] (0,0,0) -- (0,0,1) node[anchor=south east]{$\vec{r}$};
\tdplotdrawarc{(0,0,0)}{0.5}{0}{110}{anchor=north}{$\phi$}
\end{tikzpicture}
\end{document}

在此輸入影像描述

如果您不想加載該包,您可以隨時偽造曲線。

\documentclass[tikz,border=3pt]{standalone}
\begin{document}
\begin{tikzpicture}
\draw (0,0,0) node[above left] {};
\draw[thick, ->] (0,0,0) -- (2,0,0) node[anchor=north west]{$y$};
\draw[thick, ->] (0,0,0) -- (0,2,0) node[anchor=south west]{$z$};
\draw[thick, ->] (0,0,0) -- (0,0,2) node[anchor=south east]{$x$};

\draw[thick, ->,green] (0,0,0) -- (1,0,0) node[anchor=north east]
{$\vec{p}$};
\draw[thick, ->,red] (0,0,0) -- (0,1,0) node[anchor=north west]{$\vec{L}$};
\draw[thick, ->,blue] (0,0,0) -- (0,0,1) node[anchor=south east]{$\vec{r}$};
\draw[->] (0,0,0.6) arc [start angle=-90,end angle=0,x radius=0.8,y radius=0.24];
\end{tikzpicture}
\end{document}

在此輸入影像描述

相關內容