The Spherical Coordinate System

The page sketches three coordinate systems for the same point:
- Cartesian — (x,y,z).
- Cylindrical — (ρ,ϕ,z), with ϕ measured in the base plane and ρ the radial distance out from the z-axis.
- Spherical — (r,θ,ϕ), with θ measured down from the z-axis, r the radial line, rsinθ its horizontal projection and rcosθ its height.
Spherical → Cartesian
x=rsinθcosϕ
y=rsinθsinϕ
z=rcosθ
Cartesian → Spherical
r=x2+y2+z2
ϕ=arctan2(x,y)
θ=arccosrz
arctan2 takes (x,y) and returns a unique value in the range [−π,π].
Convert from spherical to Cartesian
a) (1,2π,4π)
z=rcosθcosθ=cos(2π)=0∴ z=0
sinθ(2π)=1sinϕ(4π)=22
y=1⋅1⋅22⟹y=22
x=1⋅1⋅22cosϕ∴ x=22
∴(1,2π,4π) translates to (22,22,0) in the Cartesian system.
b) (2,3π,4π)
sinθ=sin(3π)=23cosθ=cos(3π)=21
sinϕ=sin(4π)=22cosϕ=cos(4π)=22
x=2⋅23⋅22=26
y=2⋅23⋅22=26
z=2⋅21=1
∴(2,3π,4π)=(26,26,1)
Convert from Cartesian to spherical
a) (1,1,0)
r=12+12+02=2
ϕ=arctan2(1,1)=4π
θ=arccos(20)=arccos(0)=2π
⟹(2,2π,4π)
b) (1,−1,−1)
r=1+1+1=3
ϕ=arctan2(y,x)=arctan2(−1,1)=−4π
θ=arccos(rz)=arccos(3−1)=2.186 rad
⟹(3,2.186,−4π)