tikz-3D를 사용한 3D 데카르트 공간 및 앙각을 표시하기 위한 측정 호 배치

tikz-3D를 사용한 3D 데카르트 공간 및 앙각을 표시하기 위한 측정 호 배치

현재 아래 코드가 있습니다

\tdplotsetmaincoords{60}{45}
\begin{tikzpicture}[tdplot_main_coords]

    \coordinate (0) at (0,0,0);
    \tdplotsetcoord{P}{3}{45}{45} 


    \draw[thick, ->] (0,0,0) -- (3,0,0) node[anchor=north east]{$x$ (front)};
    \draw[thick, ->] (0,0,0) -- (0,3,0) node[anchor=north west]{$y$ (left)};
    \draw[thick, ->] (0,0,0) -- (0,0,3) node[anchor=south]{$z$ (up)};


    \draw[-stealth, color=red](0) -- (P) node[anchor=west]{$r$};
    \draw[dashed, color=red] (0) -- (Pxy);
    \draw[dashed, color=red] (Pxy) -- (P);

    
    \tdplotsetcoord{Pxy}{3}{\tdplotresphi}{0}
    \tdplotgetpolarcoords{1.5}{1.5}{2.12}
    \tdplotsetthetaplanecoords{\tdplotresphi}


    \tdplotdrawarc{(0)}{1.5}{0}{\tdplotresphi}{anchor=west}{$\theta$}
    \tdplotdrawarc[dashed]{(0)}{1.5}{\tdplotresphi}{90}{anchor=west}{$\phi$}

\end{tikzpicture}

\phi레이블이 지정된 각도가 현재 Pxy의 원점에서 벡터까지 측정되어 r앙각을 제공 하도록 변경하고 싶습니다 . 따라서 Pxy에서 Z축 방향으로 측정하고 위치를 지정해야 합니다.

여기에 이미지 설명을 입력하세요

답변1

설명서 27페이지에 따르면 회전된 평면으로 전환해야 합니다.

\documentclass[tikz,border=2mm]{standalone}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{60}{45}
\begin{tikzpicture}[tdplot_main_coords]

    \coordinate (0) at (0,0,0);
    \tdplotsetcoord{P}{3}{45}{45} 


    \draw[thick, ->] (0,0,0) -- (3,0,0) node[anchor=north east]{$x$ (front)};
    \draw[thick, ->] (0,0,0) -- (0,3,0) node[anchor=north west]{$y$ (left)};
    \draw[thick, ->] (0,0,0) -- (0,0,3) node[anchor=south]{$z$ (up)};


    \draw[-stealth, color=red](0) -- (P) node[anchor=west]{$r$};
    \draw[dashed, color=red] (0) -- (Pxy);
    \draw[dashed, color=red] (Pxy) -- (P);
    
    \tdplotgetpolarcoords{1.5}{1.5}{2.12}
    \tdplotsetcoord{Pxy}{3}{\tdplotresphi}{0}
    \tdplotsetthetaplanecoords{\tdplotresphi}


    \tdplotdrawarc{(0)}{1.5}{0}{\tdplotresphi}{anchor=west}{$\theta$}
    %\tdplotdrawarc[dashed]{(0)}{1.5}{\tdplotresphi}{90}{anchor=west}{$\phi$}
    
    \tdplotsetthetaplanecoords{\tdplotresphi}
    \tdplotdrawarc[tdplot_rotated_coords,dashed]{(0,0,0)}{1.5}{90}%
        {\tdplotresphi}{anchor=west}{$\phi$}


\end{tikzpicture}    
\end{document}

여기에 이미지 설명을 입력하세요

관련 정보