Three ways to locate a point in space
Cartesian coordinates (x, y, z) measure distances along three perpendicular axes. They are natural for boxes and rooms. When a problem has a center, such as a planet, an antenna or an atom, it is often easier to say how far a point is from the center and in which direction. That is what spherical coordinates do. Cylindrical coordinates are a middle ground, suited to pipes and rotating shafts.
The conventions
This calculator follows the physics convention of ISO 80000-2:
- r: distance from the origin.
- θ (polar angle): angle down from the positive z-axis, from 0° to 180°.
- φ (azimuth): angle in the xy-plane from the positive x-axis, from 0° to 360°.
Many mathematics textbooks swap the letters θ and φ. Check which convention your course or software uses before copying a formula.
The formulas
From Cartesian to spherical:
- r = √(x² + y² + z²)
- θ = arccos(z ÷ r)
- φ = atan2(y, x), the angle of the point (x, y), placed in the right quadrant
From spherical to Cartesian:
- x = r sin θ cos φ
- y = r sin θ sin φ
- z = r cos θ
Cylindrical coordinates use the same φ, the height z and the distance from the z-axis, ρ = √(x² + y²) = r sin θ.
Worked examples
The point (3, 4, 12):
- r = √(9 + 16 + 144) = 13.
- θ = arccos(12 ÷ 13) = 22.62°.
- φ = atan2(4, 3) = 53.13°.
- Cylindrical radius ρ = 5; elevation above the xy-plane: 67.38°.
Going the other way, r = 10, θ = 60°, φ = 45° gives x = y = 6.1237 and z = 5.
Where they are used
- Geography and astronomy: longitude is the azimuth and latitude is 90° − θ. Astronomers use altitude and azimuth or right ascension and declination, which follow the same idea.
- Physics: gravitational and electric fields of a point source, sound radiating from a speaker and the orbitals of the hydrogen atom are described in spherical coordinates.
- Engineering: antenna radiation patterns, radar and 3D scanners report range, azimuth and elevation.
- Computer graphics: orbiting cameras and sky domes.
Edge cases
At the origin, the angles are undefined; the calculator shows 0. On the z-axis, where x = y = 0, the azimuth is undefined and shown as 0. Angles here are in degrees; multiply by π ÷ 180 to get radians.