Drop P straight down onto the xy-plane to get P′. Then:
- ρ — flat distance from the origin to P′
- θ — angle swept from the x-axis to O→P′, in the xy-plane
- z — the same Cartesian height as before, untouched
x = ρ cos θ, y = ρ sin θ, z = z
Two views of the same point P, each swapping out two of the three Cartesian numbers for a distance and one or two angles.
Drop P straight down onto the xy-plane to get P′. Then:
Same point P. Instead of projecting first, draw the straight line O→P directly:
cart2sph typically returns elevation rather than the polar angle at all. Always check which angle is measured from the z-axis before trusting a formula from a new source.