What this converter does
This tool converts a point given in 3D Cartesian coordinates (x, y, z) into spherical coordinates (r, theta, phi). It is a pure-mathematics tool that works for any real input values and lets you choose whether the two angles are reported in degrees or radians.
The convention used here
Follow this page's convention exactly, as it can differ from other textbooks. Here r is the radial distance from the origin, theta is the azimuthal angle measured in the x-y plane from the positive x-axis, and phi is the polar (inclination) angle measured down from the positive z-axis.
The formulas
$$r = \sqrt{x^2 + y^2 + z^2}$$ The angles use the two-argument arctangent for robustness: $$\theta = \operatorname{atan2}(y,\, x) \quad\text{and}\quad \varphi = \operatorname{atan2}\!\left(\sqrt{x^2 + y^2},\, z\right)$$ Using \(\operatorname{atan2}\) instead of the naive \(\arctan(y/x)\) avoids division-by-zero and keeps the correct quadrant. All trig results are in radians; when "Degrees" is selected, each angle is multiplied by \(\frac{180}{\pi}\).
How to use it
Enter the x, y and z components of your point, pick the output angle unit, and read off r, theta and phi. r is independent of the chosen angle unit.
Worked example
For \(x = 3\), \(y = 4\), \(z = 5\) in degrees: $$r = \sqrt{9 + 16 + 25} = \sqrt{50} = 7.071068$$ $$\theta = \operatorname{atan2}(4, 3) = 0.927295 \text{ rad} = 53.130102^\circ$$ With \(\sqrt{x^2+y^2} = \sqrt{25} = 5\), $$\varphi = \operatorname{atan2}(5, 5) = \arctan(1) = 0.785398 \text{ rad} = 45^\circ$$
FAQ
What happens when x = 0? \(\operatorname{atan2}\) handles it cleanly: \(x = 0\) with \(y > 0\) gives \(\theta = 90^\circ\), and \(y < 0\) gives \(\theta = -90^\circ\).
What if z = 0? The point lies in the x-y plane, so \(\varphi = 90^\circ\) (\(\pi/2\)). A \(z < 0\) correctly yields phi greater than 90 deg.
What about the origin? If \(x = y = z = 0\) then \(r = 0\) and the angles are mathematically undefined; this tool reports 0 for both by \(\operatorname{atan2}\) convention.