Spherical

Coordinate System

Spherical Coordinate System

In spherical polar coordinates, positions are defined using three parameters: the radial distance r, the polar angle \theta, and the azimuthal angle \phi. These coordinates provide a method to locate any point in three-dimensional space based on its distance from a reference point (origin) and two angles relative to the Cartesian coordinate axes. The conversion from spherical polar to Cartesian coordinates involves expressing the Cartesian coordinates (x, y, z) in terms of r, \theta, and \phi.

Spherical coordinates

The Cartesian coordinate x is obtained by projecting the radial vector r onto the xy-plane, resulting in r \sin(\theta), and then onto the x-axis with an additional cosine modulation by the azimuthal angle \phi, leading to x = r \sin(\theta) \cos(\phi).

For the y coordinate, a similar projection onto the xy-plane yields r \sin(\theta), which is then projected onto the y-axis, modulated by the sine of the azimuthal angle, resulting in y = r \sin(\theta) \sin(\phi).

The z coordinate directly reflects the component of the radial vector along the z-axis, determined by the cosine of the polar angle, giving z = r \cos(\theta).

The polar angle \theta measures the angle from the positive z-axis to the point of interest, while the azimuthal angle \phi represents the angle in the xy-plane from the positive x-axis.

The transformations are succinctly expressed as:

\begin{aligned} & x = r \sin(\theta) \cos(\phi)\\ & y = r \sin(\theta) \sin(\phi)\\ & z = r \cos(\theta) \end{aligned}

The inverse transformation from Cartesian to spherical polar coordinates involves converting the Cartesian coordinates (x, y, z) to the spherical coordinates (r, \theta, \phi). The equations for this conversion are:

\begin{aligned} & r = \sqrt{x^2 + y^2 + z^2}\\ & \theta = \arccos\left(\frac{z}{r}\right) = \begin{cases} \arctan\left(\frac{\sqrt{x^2 + y^2}}{z}\right) & \text{if } z > 0 \\ \pi + \arctan\left(\frac{\sqrt{x^2 + y^2}}{z}\right) & \text{if } z < 0 \\ +\frac{\pi}{2} & \text{if } z = 0 \text{ and } xy \neq 0 \\ \text{undefined} & \text{if } x = y = z = 0 \end{cases}\\ & \phi = \text{sgn}(y) \arccos\left(\frac{x}{\sqrt{x^2 + y^2}}\right) = \begin{cases} \arctan\left(\frac{y}{x}\right) & \text{if } x > 0, \\ \arctan\left(\frac{y}{x}\right) + \pi & \text{if } x < 0 \text{ and } y \geq 0, \\ \arctan\left(\frac{y}{x}\right) - \pi & \text{if } x < 0 \text{ and } y < 0, \\ +\frac{\pi}{2} & \text{if } x = 0 \text{ and } y > 0, \\ -\frac{\pi}{2} & \text{if } x = 0 \text{ and } y < 0, \\ \text{undefined} & \text{if } x = 0 \text{ and } y = 0. \end{cases} \end{aligned}

These formulas take into account the full range of possible spatial relationships between a point and the coordinate axes, accurately representing points in spherical coordinates regardless of their position in 3D space.