Cylindrical to Spherical Coordinates Converter

Cylindrical to Spherical Coordinates Converter

Emerging AI Skill PRO

Enter Calculation

Formula

r=ρ2+z2,φ=atan2(ρ,z)·180π,θ=θ\begin{gathered} r = \sqrt{{\rho}^{2} + z^{2}}, \quad \varphi = \operatorname{atan2}\!\left({\rho},\; z\right)\cdot\dfrac{180}{\pi}, \quad \theta = {\theta} \end{gathered}
Usage stats

Advertisement

Results

Spherical radial distance (r)
5
distance from origin
r (radial distance) 5
θ (azimuthal angle, unchanged) 60
φ (polar angle from +z) 36.8698976458

Report an error on this page

What this converter does

This tool converts a point in 3D space from cylindrical coordinates (ρ, θ, z) into spherical coordinates (r, θ, φ). It is pure mathematics and applies everywhere — there are no region-specific rules. The tool follows the physics/ISO convention: θ is the azimuthal angle (rotation about the z-axis) and φ is the polar (inclination) angle measured from the +z axis.

The convention used

Cylindrical: ρ is the radial distance from the z-axis (ρ ≥ 0), θ is the azimuthal angle in the xy-plane, and z is the height. Spherical: r is the distance from the origin, θ is the same azimuthal angle (carried through unchanged), and φ is the angle down from the +z axis. Because r and φ depend only on ρ and z, the azimuthal angle θ never changes between the two systems.

3D diagram comparing cylindrical and spherical coordinates of one point
A single point shown with cylindrical coordinates (rho, theta, z) and spherical coordinates (r, theta, phi).

How to use it

Enter ρ, θ and z, pick whether your angles are in degrees or radians, and choose the display precision. The output gives r, the unchanged θ, and the computed φ in the same angle unit you selected.

Advertisement

The formulas explained

The radial distance is found with the Pythagorean theorem in the plane containing the z-axis and the point: $$r = \sqrt{\rho^{2} + z^{2}}$$ The polar angle is $$\varphi = \operatorname{atan2}\!\left(\rho,\; z\right)$$ We use atan2 rather than \(\operatorname{atan}(\rho/z)\) so that \(z = 0\) gives exactly 90°, \(z < 0\) returns an angle greater than 90°, and the result always lies in \([0, \pi]\).

Right triangle relating rho, z, r and angle phi
The right triangle in the vertical plane: r is the hypotenuse, with legs rho and z and angle phi at the top.

Worked example

For \(\rho = 3\), \(\theta = 60°\), \(z = 4\): $$r = \sqrt{9 + 16} = \sqrt{25} = 5$$ $$\varphi = \operatorname{atan2}(3, 4) = \operatorname{atan}(0.75) = 36.86989765°$$ θ stays 60°. So the spherical coordinates are \((5,\; 60°,\; 36.86989765°)\).

More Worked Examples

All three examples use the conversion formulas \(r = \sqrt{\rho^{2} + z^{2}}\), \(\varphi = \operatorname{atan2}(\rho, z)\) and \(\theta_{\text{sph}} = \theta_{\text{cyl}}\). Here \(\varphi\) is the polar angle measured from the +z axis, and the azimuth \(\theta\) carries over unchanged.

Example 1: A point below the xy-plane

Convert \((\rho, \theta, z) = (1, \pi/4, -1)\).

  1. Radial distance: \(r = \sqrt{1^{2} + (-1)^{2}} = \sqrt{2} \approx 1.4142\).
  2. Polar angle: \(\varphi = \operatorname{atan2}(1, -1) = 3\pi/4 \approx 2.3562\) rad, which is 135°. It is greater than 90° because z is negative, so the point lies below the xy-plane.
  3. Azimuth: \(\theta = \pi/4\) (45°), unchanged.

Result: \((r, \theta, \varphi) = (\sqrt{2}, \pi/4, 3\pi/4)\).

Example 2: A point on the +z axis

Convert \((\rho, \theta, z) = (0, \text{any}, 5)\).

  1. Radial distance: \(r = \sqrt{0^{2} + 5^{2}} = 5\).
  2. Polar angle: \(\varphi = \operatorname{atan2}(0, 5) = 0\) (0°), because the point lies along the +z axis.
  3. Azimuth: on the axis, \(\theta\) has no geometric effect, so the input value is simply carried through.

Result: \((r, \varphi) = (5, 0)\).

Example 3: A point in the xy-plane

Convert \((\rho, \theta, z) = (2, 210^\circ, 0)\).

  1. Radial distance: \(r = \sqrt{2^{2} + 0^{2}} = 2\).
  2. Polar angle: \(\varphi = \operatorname{atan2}(2, 0) = \pi/2\) rad = 90°, because the point lies in the xy-plane.
  3. Azimuth: \(\theta = 210^\circ = 7\pi/6 \approx 3.6652\) rad, unchanged.

Result: \((r, \theta, \varphi) = (2, 210^\circ, 90^\circ)\).

Advertisement

Common Cylindrical to Spherical Conversions

The table lists sample \((\rho, z)\) pairs with the resulting \(r\) and \(\varphi\). The azimuth \(\theta\) is not shown because it is the same in both systems, so any \(\theta\) carries through unchanged.

ρ z r = √(ρ² + z²) φ = atan2(ρ, z) (degrees) φ (radians)
1 0 1 90° π/2 ≈ 1.5708
1 1 √2 ≈ 1.4142 45° π/4 ≈ 0.7854
1 -1 √2 ≈ 1.4142 135° 3π/4 ≈ 2.3562
0 1 1 0° 0
0 -1 1 180° π ≈ 3.1416
3 4 5 ≈ 36.87° ≈ 0.6435
1 √3 2 30° π/6 ≈ 0.5236

FAQ

Why does θ not change? Both systems measure the azimuthal angle the same way about the z-axis, so it simply carries through.

What happens when z = 0? The point lies in the xy-plane, so \(\varphi = 90°\) (\(\pi/2\)). atan2 handles this without dividing by zero.

What if ρ = 0 and z = 0? The point is the origin: \(r = 0\) and φ is mathematically undefined (the tool returns 0).

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators