我有一个关于该命令的非常简单的问题\tdplotdrawarc
。
基本上,我有一个显示球面坐标参考系的代码,我唯一想做的就是将该角度标记为\theta
当前标记的角度的补角。
问题是我试图弄清楚这样的命令是如何工作的,但经过几次尝试后,我猜有些事情对我来说还不清楚。
有人能帮助我解决这些简单问题并让我更好地理解\tdplotdrawarc
这种情况下的工作方式吗?
提前致谢 :)
\documentclass{article}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{60}{110}
%
\pgfmathsetmacro{\rvec}{.8}
\pgfmathsetmacro{\thetavec}{30}
\pgfmathsetmacro{\phivec}{60}
%
\begin{tikzpicture}[scale=5,tdplot_main_coords]
\coordinate (O) at (0,0,0);
\draw[thick,->] (0,0,0) -- (1,0,0) node[anchor=north east]{$x_{1}$};
\draw[thick,->] (0,0,0) -- (0,1,0) node[anchor=north west]{$x_{2}$};
\draw[thick,->] (0,0,0) -- (0,0,1) node[anchor=south]{$x_{3}$};
\tdplotsetcoord{P}{\rvec}{\thetavec}{\phivec}
\draw[-stealth,color=red] (O) -- (P) node[above right]{$\bf{e_{\sigma}}$};
\draw[dashed, color=red] (O) -- (Pxy);
\draw[dashed, color=red] (P) -- (Pxy);
\tdplotdrawarc{(O)}{0.2}{0}{\phivec}{anchor=north}{$\phi$}
\tdplotsetthetaplanecoords{\phivec}
\tdplotdrawarc[tdplot_rotated_coords]{(0,0,0)}{0.5}{0}%
{\thetavec}{anchor=south west}{$\theta$}
\end{tikzpicture}
\end{document}
答案1
我的问题答对了吗?
这包装文档读作:
\tdplotdrawarc[coordinate system, draw styles] {center}{r}{angle start}{angle end}{label options}{label}
还有更清楚的吗?
输出
代码
\documentclass[12pt,tikz]{standalone}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{60}{110}
%
\pgfmathsetmacro{\rvec}{.8}
\pgfmathsetmacro{\thetavec}{30}
\pgfmathsetmacro{\phivec}{60}
%
\begin{tikzpicture}[scale=5,tdplot_main_coords]
\coordinate (O) at (0,0,0);
\begin{scope}[thick,->]
\def\l{.8}
\draw (O) -- (\l,0,0) node[pos=1.15]{$x_{1}$} ;
\draw (O) -- (0,\l,0) node[pos=1.1]{$x_{2}$} ;
\draw (O) -- (0,0,\l) node[pos=1.05]{$x_{3}$};
\end{scope}
\tdplotsetcoord{P}{\rvec}{\thetavec}{\phivec}
\draw[-stealth,color=red] (O) -- (P) node[pos=1.1]{$\bf{e_{\sigma}}$};
\tdplotdrawarc{(O)}{0.2}{0}{\phivec}{anchor=north}{$\phi$}
\tdplotsetthetaplanecoords{\phivec}
\tdplotdrawarc[tdplot_rotated_coords,blue]
{(0,0,0)}{0.5}{\thetavec}{90}{anchor=south west}{$\theta$}
\draw[dashed, color=red] (O) -- (Pxy) -- (P) ;
\tdplotsetcoord{Pp}{.5}{90}{\phivec}
\draw[blue!30] (Pxy) -- (Pp);
\end{tikzpicture}
\end{document}