Skip to content
Omnikalc

Convert between Cartesian, spherical and cylindrical coordinates

Convert a point in 3D space from Cartesian (x, y, z) to spherical (r, θ, φ) and cylindrical (ρ, φ, z) coordinates, or back from spherical to Cartesian.

Updated on
Your inputs
Convert from

Value out of range

Value out of range

Value out of range

Value out of range

°

Value out of range

°

Value out of range

Results

Radius r

13.0000

Polar angle θ

22.6199 °

Azimuth φ (0 to 360°)

53.1301 °

x
3.0000
y
4.0000
z
12.0000
Cylindrical radius ρ
5.0000
Elevation above the xy-plane (90° − θ)
67.3801 °

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.

Frequently asked questions

What are spherical coordinates?

A way to locate a point in space by its distance r from the origin, its polar angle θ measured down from the z-axis and its azimuth φ measured in the xy-plane from the x-axis. They suit problems with a center, such as gravity, antennas or atoms.

What are the conversion formulas?

From spherical to Cartesian: x = r sin θ cos φ, y = r sin θ sin φ, z = r cos θ. Back: r = √(x² + y² + z²), θ = arccos(z ÷ r), φ = atan2(y, x).

Why do textbooks swap θ and φ?

Physics and the ISO 80000-2 standard use θ for the polar angle and φ for the azimuth, as here. Many US mathematics textbooks use the opposite. Always check which convention a formula uses.

How do spherical coordinates relate to latitude and longitude?

Longitude is the azimuth φ, and latitude is the elevation, 90° − θ. Geographers measure latitude from the equator, while the polar angle is measured from the North Pole.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.