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
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.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
- Convert: choose Cartesian (x, y, z) to spherical (r, θ, φ) or Spherical (r, θ, φ) to Cartesian (x, y, z).
- x, or r (distance from the origin): enter a number.
- y, or θ (polar angle from the +z axis, degrees): enter a number.
- z, or φ (azimuth from the +x axis, degrees): enter a number.
- 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
| Symbol | Meaning |
|---|---|
| Convert (1: Cartesian (x, y, z) to spherical (r, θ, φ); 2: Spherical (r, θ, φ) to Cartesian (x, y, z)) | |
| x, or r (distance from the origin) | |
| y, or θ (polar angle from the +z axis, degrees) | |
| z, or φ (azimuth from the +x axis, degrees) | |
| r = √(x² + y² + z²) |
Worked example
| Convert | Cartesian (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 |
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.