3

I have X coordinate defined in Spherical coordinate system (the point is to be situated on the circle so it's easier):

\def\Sx{0} \def\Sy{0} \def\Sz{2}
\pgfmathsetmacro\Sρ{"sqrt((\Sx)^(2)+(\Sy)^(2)+(\Sz)^(2))"}
\pgfmathsetmacro\Sθ{ifthenelse(\Sx==0&&\Sy==0&&\Sz==0,0,"acos(\Sz/(sqrt((\Sx)^(2)+(\Sy)^(2)+(\Sz)^(2))))")}
\pgfmathsetmacro\SΦ{ifthenelse(\Sx==0&&\Sy==0,0,ifthenelse(\Sy<0,"-acos(\Sx/(sqrt((\Sx)^(2)+(\Sy)^(2))))","acos(\Sx/(sqrt((\Sx)^(2)+(\Sy)^(2))))"))}
\tdplotsetcoord{S}{\Sρ}{\Sθ}{\SΦ}
\coordinate (X) at ($(S)+(xyz spherical cs:radius=2,longitude=-40,latitude=0)$);

However X coordinate defined this way cannot be extracted into x,y,z components:

% calc library    
\newdimen\Xx \pgfextractx{\Xx}{\pgfpointanchor{X}{center}} % this doesn't work for me

How can be coordinate defined in Spherical coord. system and then extracted into x,y,z or ρ,θ,Φ? Thanks.

user46581
  • 575

0 Answers0