Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xyz spherical: longitude should be measured from x axis #1360

Open
Firestar-Reimu opened this issue Sep 19, 2024 · 3 comments
Open

xyz spherical: longitude should be measured from x axis #1360

Firestar-Reimu opened this issue Sep 19, 2024 · 3 comments

Comments

@Firestar-Reimu
Copy link

Firestar-Reimu commented Sep 19, 2024

Brief outline of the proposed feature

/tikz/cs/radius=<number>
Factor by which the x-, y-, and z-vector are multiplied.
(no default, initially 0)
/tikz/cs/latitude=<degrees>
 (no default, initially 0)
Angle of the coordinate between the y- and z-vector, measured from the y-vector.
/tikz/cs/longitude=<degrees>
 (no default, initially 0)
Angle of the coordinate between the x- and y-vector, measured from the y-vector.

First, longitude should be measured from x-vector, and should follow the right-hand-rule, like this φ:

image

Second, latitude should be measured from xy-plane (not y-vector), like this 90-θ (or you can use the polar angle θ which is measured from z-vector)

Third, radius is not x-, y-, z-vector multiplied, but $\sqrt{x^2 + y^2 + z^2}$

Minimal working example (MWE)

\documentclass{article}
\usepackage{tikz,tikz-3dplot}
    \begin{document}
            \tdplotsetmaincoords{75}{105}
            \begin{tikzpicture}[tdplot_main_coords]
            \begin{scope}[canvas is xy plane at z=0]
                \draw (0,0) circle (3cm);
                \draw [->,dashed] (-3,0) -- (3,0) node {$x$};
                \draw [->,black,dashed] (0,-3) -- (0,3) node {$y$};
            \end{scope}
            \draw [->,red,dashed] (0,0,0) -- (0,0,3) node {$z$};
            \draw [blue] (0,0,0) -- (xyz spherical cs:radius=3,longitude=60,latitude=0);
            \draw [green] (0,0,0) -- (xyz spherical cs:radius=3,longitude=60,latitude=60);
            \end{tikzpicture}
    \end{document}

image

you can see that the longitude=60 is measured from y-vector and follow the left-hand-rule, which is not compatible with Physicists and Mathematicians.

@hmenke
Copy link
Member

hmenke commented Sep 19, 2024

That's unfortunate, but it has been like that for quite some time so we cannot change this anymore. Otherwise we would break all the drawings that rely on this convention. Therefore I've marked your issue as a feature request.

@hmenke hmenke added the 3d label Sep 19, 2024
@Firestar-Reimu
Copy link
Author

So why you set the coordinate like this at first?

@hmenke
Copy link
Member

hmenke commented Oct 6, 2024

I have no idea why it was set this way. It was introduced all the way back in 2006. You can try to contact the original author to maybe get an answer.
e150a7c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants