Skip to content
FiftyCalc Free calculators for all 50 states

Spherical Coordinates Calculator

Test cases replayed : 4 of 4 match · Methodology · No outside source listed

Choose the direction, then enter x, y and z, or r, the polar angle θ and the azimuth φ (both in degrees).

Result

Sample figures

r = √(x² + y² + z²)—

θ = arccos(z ÷ r) (degrees, 0 to 180) —

  • φ = atan2(y, x) (degrees, −180 to 180)—
  • x = r sin θ cos φ—
  • y = r sin θ sin φ—
  • z = r cos θ—
  • Distance from the z-axis √(x² + y²) = r sin θ—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

Spherical Coordinates Calculator

Convert: choose Cartesian (x, y, z) to spherical (r, θ, φ) or Spherical (r, θ, φ) to Cartesian (x, y, z). Prefilled example: Cartesian (x, y, z) to spherical (r, θ, φ).

x, or r (distance from the origin): enter a number. Prefilled example: 1.

y, or θ (polar angle from the +z axis, degrees): enter a number. Prefilled example: 2.

z, or φ (azimuth from the +x axis, degrees): enter a number. Prefilled example: 2.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. Convert: choose Cartesian (x, y, z) to spherical (r, θ, φ) or Spherical (r, θ, φ) to Cartesian (x, y, z).
  2. x, or r (distance from the origin): enter a number.
  3. y, or θ (polar angle from the +z axis, degrees): enter a number.
  4. z, or φ (azimuth from the +x axis, degrees): enter a number.
  5. Read the result: r = √(x² + y² + z²); the panel also shows θ = arccos(z ÷ r) (degrees, 0 to 180), φ = atan2(y, x) (degrees, −180 to 180), x = r sin θ cos φ, y = r sin θ sin φ, z = r cos θ and Distance from the z-axis √(x² + y²) = r sin θ.

How this calculator works

This calculator uses the convention of ISO 80000-2, common in physics: r is the distance from the origin, θ the polar angle measured down from the positive z-axis (0° to 180°) and φ the azimuth measured in the xy-plane from the positive x-axis.

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

Many calculus textbooks swap the letters (θ for the azimuth, φ for the polar angle); the numbers are the same, only the names change. At the origin the angles are undefined and show —.

The formula

  1. R={u2+v2+w2if m=1uotherwise
Symbols used in the formula
SymbolMeaning
mConvert (1: Cartesian (x, y, z) to spherical (r, θ, φ); 2: Spherical (r, θ, φ) to Cartesian (x, y, z))
ux, or r (distance from the origin)
vy, or θ (polar angle from the +z axis, degrees)
wz, or φ (azimuth from the +x axis, degrees)
Rr = √(x² + y² + z²)

Worked example

ConvertCartesian (x, y, z) to spherical (r, θ, φ)
x, or r (distance from the origin)1
y, or θ (polar angle from the +z axis, degrees)2
z, or φ (azimuth from the +x axis, degrees)2
θ = arccos(z ÷ r) (degrees, 0 to 180)48.1897
φ = atan2(y, x) (degrees, −180 to 180)63.4349
x = r sin θ cos φ1
y = r sin θ sin φ2
z = r cos θ2
Distance from the z-axis √(x² + y²) = r sin θ2.2361
  1. R=12+22+22=3

r = √(x² + y² + z²) 3

Each step uses the unrounded value of the step before it; figures on this page are rounded for display.

Frequently asked questions

What are the spherical coordinates of (1, 2, 2)?

r = 3, θ = arccos(2/3) ≈ 48.1897° and φ = atan2(2, 1) ≈ 63.4349°.

Which angle is θ and which is φ?

Here θ is measured from the z-axis and φ around it, as in ISO 80000-2. Some math books use the opposite letters.

Can r be negative?

Not in the usual convention: r is a distance, so it is 0 or more.

Questions answered

Related calculators