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.
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.
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]\).
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)\).
- Radial distance: \(r = \sqrt{1^{2} + (-1)^{2}} = \sqrt{2} \approx 1.4142\).
- 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.
- 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)\).
- Radial distance: \(r = \sqrt{0^{2} + 5^{2}} = 5\).
- Polar angle: \(\varphi = \operatorname{atan2}(0, 5) = 0\) (0°), because the point lies along the +z axis.
- 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)\).
- Radial distance: \(r = \sqrt{2^{2} + 0^{2}} = 2\).
- Polar angle: \(\varphi = \operatorname{atan2}(2, 0) = \pi/2\) rad = 90°, because the point lies in the xy-plane.
- Azimuth: \(\theta = 210^\circ = 7\pi/6 \approx 3.6652\) rad, unchanged.
Result: \((r, \theta, \varphi) = (2, 210^\circ, 90^\circ)\).
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).