Spherical Coordinates Calculator
This spherical coordinates calculator converts a point between Cartesian (x, y, z), spherical (ρ, θ, φ) and cylindrical coordinates, in the math or physics convention. You get exact values, every step and a 3D view of the distance and both angles.
- Exact radicals and π fractions
- Math and physics conventions
- Degrees and radians
- 3
- conversions
- 2
- angle conventions
- 10
- ready-made examples
Results
Your point, in 3D and step by step
The green line is the distance from the origin. The orange arc is the azimuth in the xy-plane, and the red arc is the polar angle measured down from the +z axis.
Interactive diagram
3D point view
Converted point
Step-by-step solution
—Step by step
How to Use the Spherical Coordinates Calculator
To use the spherical coordinates calculator, follow these 6 steps. The preview, the point and the 3D view update as you type.
- 1
Choose the conversion
To spherical converts rectangular x, y, z. To Cartesian converts ρ, θ, φ. Cylindrical converts r, θ, z to spherical.
- 2
Pick your textbook's convention
Math uses (ρ, θ, φ) with θ as the azimuth. Physics and ISO 80000-2 use (r, θ, φ) with θ as the polar angle.
- 3
Set the angle unit
Choose degrees or radians for angle inputs. A value with pi, such as
pi/3, always counts as radians. - 4
Enter the three values
Type numbers or expressions:
1,-4,sqrt(2),2*sqrt(3),45°. - 5
Convert
Press Convert coordinates or Enter. Results refresh on their own while you type.
- 6
Read the point, steps and 3D view
Read the converted point in both conventions, open the steps, and drag the 3D view. Toggle the sphere, cone and half-plane through the point.
iThe result panel lists the distance, the azimuth and the polar angle in degrees and radians, plus x, y, z, the cylindrical form, latitude and longitude, and the elevation angle.
Definition
What Are Spherical Coordinates?
Spherical coordinates are three numbers that locate a point in three-dimensional space by its distance from the origin and two angles. The spherical coordinate system is built from a fixed origin and a zenith direction, the direction from the origin straight up to the zenith. Here the zenith direction is the +z axis.
The 3 spherical coordinates are:
- Radial distance ρ (the radius, written r in physics): the straight-line distance from the origin to the point. ρ ≥ 0.
- Azimuth angle θ: the angle in the XY plane from the +x axis to the point's shadow, measured counterclockwise. 0° ≤ θ < 360° (0 to 2π).
- Polar angle φ (the zenith or inclination angle): the angle from the +z axis down to the line through the point. 0° ≤ φ ≤ 180° (0 to π).
The rectangular coordinate system, or Cartesian system, uses three perpendicular axes through the origin instead. Each pair of axes spans a plane: the XY plane, the XZ plane and the YZ plane. A point's x, y and z are its signed distances from the YZ, XZ and XY planes.
Spherical coordinates suit shapes centered on a point: spheres, cones, planets, antenna patterns and gravitational or electric fields around a charge. A sphere of radius 3 is just ρ = 3.
φ above 90° puts the point below the xy-plane, so z turns negative. Drag the view to rotate it.
Math convention vs physics convention
The math and physics conventions use the same formulas with the angle letters swapped. American calculus textbooks, OpenStax included, write (ρ, θ, φ). Physics, engineering and the ISO 80000-2 standard write (r, θ, φ), and Omni Calculator follows this physics order.
| Quantity | Math convention | Physics / ISO 80000-2 | Range | Other names |
|---|---|---|---|---|
| Distance from the origin | ρ | r | [0, ∞) | radius, radial distance |
| Angle around the z-axis, from +x | θ | φ | [0°, 360°) or [0, 2π) | azimuth, azimuthal angle, longitude |
| Angle down from +z | φ | θ | [0°, 180°] or [0, π] | polar, zenith, inclination angle, colatitude |
| Order written | (ρ, θ, φ) | (r, θ, φ) | — | — |
iPoint (0, 3, −4) is (5, 90°, 143.13°) in the math convention and (5, 143.13°, 90°) in the physics convention. The numbers move; the point stays put. Swapping them by mistake sends the point somewhere else.
Formulas
Spherical Coordinates Formulas
The spherical coordinates formulas come from 2 right triangles: one in the vertical plane through the point and the z-axis, and one in the xy-plane. All formulas below use the math convention (ρ, θ, φ).
θ is the same in both systems.
The law of cosines, with γ the angle between the two position vectors.
Left: ρ splits into a height z = ρ cos φ and a shadow r = ρ sin φ. Right: the shadow r splits into x = r cos θ and y = r sin θ. Put them together and x = ρ sin φ cos θ.
Gradient, divergence, curl and Laplacian in spherical coordinates
Vector calculus operators pick up scale factors in spherical coordinates. These 4 formulas use the physics convention (r, θ, φ) with θ as the polar angle, the form printed in most physics and engineering references.
| Operator | Formula |
|---|---|
| Gradient | |
| Divergence | |
| Curl | |
| Laplacian |
iDegrees and radians convert with 1 rad = 180°/π ≈ 57.2958° and 1° = π/180 ≈ 0.017453 rad. Every formula on this page works in either unit, as long as the calculator's trigonometric functions match the unit you entered.
Rectangular to spherical
How to Convert Cartesian to Spherical Coordinates
To convert Cartesian to spherical coordinates, follow 3 steps: find the distance ρ, find the azimuth θ from the quadrant of (x, y), then find the polar angle φ from z.
- Find ρ. ρ = √(x² + y² + z²). For (−1, −1, −1), ρ = √3 ≈ 1.7321.
- Find θ from (x, y). Take the reference angle α = arctan|y/x|, then adjust it by the quadrant. (−1, −1) is in Quadrant III, so θ = 180° + 45° = 225° = 5π/4.
- Find φ. φ = arccos(z/ρ) = arccos(−1/√3) ≈ 125.26°. A polar angle above 90° means the point is below the xy-plane.
| Quadrant of (x, y) | Signs | Azimuth θ | Example |
|---|---|---|---|
| Quadrant I | x > 0, y > 0 | α | (1, 1) → 45° |
| Quadrant II | x < 0, y > 0 | 180° − α | (−1, 1) → 135° |
| Quadrant III | x < 0, y < 0 | 180° + α | (−1, −1) → 225° |
| Quadrant IV | x > 0, y < 0 | 360° − α | (1, −1) → 315° |
| On the z-axis | x = y = 0 | undefined (0 by convention) | (0, 0, 5) → (5, 0, 0) |
The dashed red ray is plain arctan(y/x). It agrees with θ only in Quadrants I and IV; in II and III it points the opposite way.
Spherical to rectangular
How to Convert Spherical to Cartesian Coordinates
To convert spherical to Cartesian coordinates, follow 3 steps: find the shadow length ρ sin φ, split it into x and y with cos θ and sin θ, then find the height z = ρ cos φ.
- Find the shadow length r = ρ sin φ. For (4, 45°, 60°): r = 4 · sin 60° = 4 · √3/2 = 2√3 ≈ 3.4641.
- Split r into x and y. x = r cos θ = 2√3 · √2/2 = √6 ≈ 2.4495, and y = r sin θ = √6.
- Find z = ρ cos φ. z = 4 · cos 60° = 4 · ½ = 2. The point is (√6, √6, 2).
| Angle | 0° | 30° | 45° | 60° | 90° | 120° | 135° | 180° |
|---|---|---|---|---|---|---|---|---|
| Radians | 0 | π/6 | π/4 | π/3 | π/2 | 2π/3 | 3π/4 | π |
| sin | 0 | 1/2 | √2/2 | √3/2 | 1 | √3/2 | √2/2 | 0 |
| cos | 1 | √3/2 | √2/2 | 1/2 | 0 | −1/2 | −√2/2 | −1 |
Exact radicals appear for multiples of 30° and 45°. Other angles, such as (3, 20°, 70°), give decimals: (2.6491, 0.9642, 1.0261).
- 1. Go up the +z axis a distance ρ = 4.
- 2. Tilt down from +z by φ = 60°: z becomes 4 cos 60° = 2.
- 3. Turn around the z-axis by θ = 45°: x = y = √6.
Worked examples
Spherical Coordinates Examples With Solutions
Here are 6 spherical coordinates examples with solutions: 3 rectangular to spherical, 2 spherical to rectangular and 1 cylindrical to spherical. Each 3D view shows the point, and each button loads the problem into the calculator.
Example 1: (1, 1, √2) to spherical
Answer: , the same in both conventions here, since θ = φ.
Example 2: (0, 3, −4) to spherical
Answer: (5, 90°, 143.13°) in math form; physics form (r, θ, φ) = (5, 143.13°, 90°).
Example 3: (−1, −1, −1) to spherical
Answer: (√3, 225°, 125.26°). arctan(−1/−1) alone would give 45°, the wrong quadrant.
Example 4: (4, 45°, 60°) to rectangular
Answer:
Example 5: (2, π, π/2) to rectangular
Answer: (−2, 0, 0), on the negative x-axis. φ = π/2 keeps the point in the xy-plane.
Example 6: cylindrical (2√3, 45°, 2) to spherical
Answer: (4, 45°, 60°), the same point as Example 4.
Check a conversion with a second tool
8 other tools convert spherical coordinates, and each one has its own labels. The Omni Calculator spherical coordinates calculator at omnicalculator.com uses the physics order (r, θ, φ). CalcBee (calcbee.pages.dev) adds cylindrical coordinates and a convention toggle, and MathCheck (mathcheck.net) shows exact radicals with a math/physics switch. Wolfram Alpha accepts plain-text input such as "(1, 1, sqrt 2) in spherical coordinates". Mathematica uses CoordinateTransform["Cartesian" -> "Spherical", {x, y, z}], which returns the polar angle second. MATLAB's cart2sph returns the azimuth, the elevation from the xy-plane and the radius, so φ = 90° − elevation. GeoGebra and Desmos graph surfaces in spherical form, and Symbolab, Mathway and Maple evaluate the three formulas once you type them in.
Integration
Spherical Coordinates in Triple Integrals
Spherical coordinates turn triple integrals over balls, shells and cones into integrals with constant limits. The volume element is dV = ρ² sin φ dρ dθ dφ, where ρ² sin φ is the Jacobian of the conversion.
The factor ρ² sin φ is the determinant of the 3 × 3 matrix of partial derivatives of (x, y, z) with respect to (ρ, θ, φ). Leaving it out is the most common error in spherical triple integrals.
Worked example 1: volume of a ball
A ball of radius 3 cm holds 36π ≈ 113.10 cm³, about 113.1 mL (3.82 US fl oz).
Worked example 2: an ice cream cone
The solid inside the sphere ρ = 2 and above the cone φ = π/4 has volume
A double integral in spherical coordinates appears on the surface of a sphere: dS = R² sin φ dφ dθ. Over the full sphere it gives the surface area 4πR², and with R = 1 it gives the full solid angle 4π ≈ 12.566 steradians.
As the box shrinks, ρ² sin φ ΔρΔθΔφ approaches its exact volume. Near the z-axis (φ near 0° or 180°) the box gets thin, so sin φ shrinks it.
Equations
Equations of Common Surfaces in Spherical Coordinates
The equations of common surfaces in spherical coordinates are short when the surface is centered on the origin or the z-axis. 3 surfaces need only one coordinate: a sphere is ρ = a, a cone is φ = c and a half-plane is θ = c.
| Surface | Cartesian equation | Spherical equation |
|---|---|---|
| Sphere, center origin | ||
| Cone around the z-axis | ||
| Half-plane through the z-axis | ||
| xy-plane | ||
| Horizontal plane | ||
| Cylinder | ||
| Sphere on the z-axis | ||
| Sphere on the x-axis |
iTo rewrite a surface, substitute x = ρ sin φ cos θ, y = ρ sin φ sin θ and z = ρ cos φ, then use x² + y² + z² = ρ² and x² + y² = ρ² sin² φ. Divide by ρ only after checking the origin separately.
Avoid these
Common Mistakes in Spherical Coordinate Conversion
There are 8 common mistakes in spherical coordinate conversion. Each card pairs the mistake with its fix.
Mixing the math and physics conventions
Check which letter your course uses for the polar angle. Swapping θ and φ moves the point to a different place.
Measuring φ from the xy-plane
φ starts at the +z axis. An angle up from the xy-plane is the elevation: φ = 90° − elevation.
Plain arctan(y/x) for θ
Use atan2(y, x) or the quadrant rule. (−1, −1) has θ = 225°, not 45°.
Degrees and radians mixed
sin 60 in radians is −0.3048, not √3/2. Keep every angle in one unit.
A negative ρ
ρ is a distance, so ρ ≥ 0. Point a negative direction with the angles instead.
φ above 180°
The polar angle runs from 0° to 180°. θ covers the other half of the turn.
Forgetting ρ² sin φ in integrals
dV = ρ² sin φ dρ dθ dφ. Without it, the unit ball's volume comes out as 2π² instead of 4π/3.
Treating latitude as φ
Latitude is measured from the equator: φ = 90° − latitude. 40° N is φ = 50°.
Questions
Frequently Asked Questions
How do you convert Cartesian to spherical coordinates?
To convert Cartesian to spherical coordinates, compute ρ = √(x² + y² + z²), θ = atan2(y, x) and φ = arccos(z / ρ). For (1, 1, √2): ρ = √4 = 2, θ = 45° (π/4) and φ = arccos(√2/2) = 45° (π/4), so the point is (2, π/4, π/4).
What is the difference between θ and φ in spherical coordinates?
The difference between θ and φ in spherical coordinates is which angle each letter names, and that depends on the convention. In the math convention of American calculus textbooks, θ is the azimuth around the z-axis and φ is the polar angle from the +z axis. In the physics convention and ISO 80000-2, the letters swap: θ is the polar angle and φ is the azimuth.
Is φ measured from the z-axis or the xy-plane?
φ is measured from the positive z-axis in the math convention, so φ = 0° points straight up, φ = 90° lies in the xy-plane and φ = 180° points straight down. An angle measured up from the xy-plane is the elevation (or latitude), equal to 90° − φ. MATLAB cart2sph returns the elevation, not φ.
How do you find θ in the correct quadrant?
To find θ in the correct quadrant, use atan2(y, x), or take the reference angle α = arctan|y/x| and adjust it by the quadrant of (x, y): θ = α in Quadrant I, 180° − α in Quadrant II, 180° + α in Quadrant III and 360° − α in Quadrant IV. Plain arctan(y/x) gives 45° for (−1, −1), but the correct azimuth is 225°.
What is the volume element in spherical coordinates?
The volume element in spherical coordinates is dV = ρ² sin φ dρ dθ dφ. The factor ρ² sin φ is the Jacobian determinant of the map from (ρ, θ, φ) to (x, y, z). Integrating it over 0 ≤ ρ ≤ R, 0 ≤ θ ≤ 2π, 0 ≤ φ ≤ π gives the ball volume 4πR³/3.
How are spherical coordinates related to latitude and longitude?
Spherical coordinates relate to latitude and longitude through latitude = 90° − φ and longitude = θ (written from −180° to 180°), with the Earth's center as the origin and the North Pole on the +z axis. A polar angle of 30° is latitude 60° N, and a polar angle of 120° is latitude 30° S. Google Maps lists places by latitude and longitude in degrees.
This spherical coordinates calculator converts rectangular to spherical, spherical to rectangular and cylindrical to spherical coordinates, in degrees and radians and in the math and physics conventions, with steps and a 3D view of ρ, θ and φ.
