Skip to main content

Point transformation rectangular-spherical

Short answer

Rectangular to spherical: r = √(x²+y²+z²), θ = cos⁻¹(z/r), φ = tan⁻¹(y/x) with quadrant. Spherical to rectangular: x = r sinθ cosφ, y = r sinθ sinφ, z = r cosθ. Example: (1,1,√2) gives r=2, θ=45°, φ=45°.

Transform a point (x, y, z) in rectangular co-ordinates to a point (r, θ, φ) in spherical co-ordinates and vice-versa.

A point can be located by (x, y, z) in rectangular coordinates or by (r, θ, φ) in spherical coordinates, where r is the distance from the origin, θ is the polar angle measured from the +z axis (0 ≤ θ ≤ π) and φ is the azimuth angle measured from the +x axis in the xy-plane (0 ≤ φ < 2π).

              z
              │   P(r, θ, φ)
              │  ╱│
              │θ╱ │
              │╱  │
              ●───┼──── y
             ╱ ╲φ │
            x    ╲│

Rectangular to spherical

r = √(x² + y² + z²)            (r ≥ 0)
θ = cos⁻¹ ( z / √(x² + y² + z²) )   (0 ≤ θ ≤ π)
φ = tan⁻¹ ( y / x )            (take the quadrant from the signs of x and y)

Spherical to rectangular

x = r sinθ cosφ
y = r sinθ sinφ
z = r cosθ

How the relations arise: The projection of OP on the xy-plane is ρ = r sinθ. Resolving ρ along x and y gives x = ρ cosφ and y = ρ sinφ, and the z-component is r cosθ. Squaring and adding gives x² + y² + z² = r².

Example: P(1, 1, √2): r = √(1 + 1 + 2) = 2, θ = cos⁻¹(√2/2) = 45°, φ = tan⁻¹(1) = 45°. Back: x = 2 sin45° cos45° = 1, y = 1, z = 2 cos45° = √2. ✓

✓ Answer checked by Claude Opus 5.5 (high effort)

All Electromagnetism chapter 1 questions →