# Spherical coordinate system

In mathematics, a spherical coordinate system is a coordinate system for three-dimensional space where the position of a given point in space is specified by three numbers, (r, θ, φ): the radial distance of the radial line r connecting the point to the fixed point of origin (which is located on a fixed polar axis, or zenith direction axis, or z-axis); the polar angle θ of the radial line r; and the azimuthal angle φ of the radial line r.

The polar angle θ is measured between the z-axis and the radial line r. The azimuthal angle φ is measured between the orthogonal projection of the radial line r onto the reference x-y-plane—which is orthogonal to the z-axis and passes through the fixed point of origin—and either of the fixed x-axis or y-axis, both of which are orthogonal to the z-axis and to each other. (See graphic re the "physics convention".)

Once the radius is fixed, the three coordinates (r, θ, φ), known as a 3-tuple, provide a coordinate system on a sphere, typically called the spherical polar coordinates. Nota bene: the physics convention is followed in this article; (See both graphics re "physics convention" and re "mathematics convention").

The radial distance from the fixed point of origin is also called the radius, or radial line, or radial coordinate. The polar angle may be called inclination angle, zenith angle, normal angle, or the colatitude. The user may choose to ignore the polar angle and use the elevation angle instead, which is measured upward between the reference plane and the radial line—i.e., from the reference plane upward (towards to the positive z-axis) to the radial line. The depression angle is the negative of the elevation angle. (See graphic re the "physics convention"—not "mathematics convention".)

Both the use of symbols and the naming order of tuple coordinates differ among the several sources and disciplines. This article will use the ISO convention frequently encountered in physics, where the naming tuple gives the order as: radial distance, polar angle, azimuthal angle, or ${\displaystyle (r,\theta ,\varphi )}$. (See graphic re the "physics convention".) In contrast, the conventions in many mathematics books and texts give the naming order differently as: radial distance, "azimuthal angle", "polar angle", and ${\displaystyle (\rho ,\theta ,\varphi )}$ or ${\displaystyle (r,\theta ,\varphi )}$—which switches the uses and meanings of symbols θ and φ. Other conventions may also be used, such as r for a radius from the z-axis that is not from the point of origin. Particular care must be taken to check the meaning of the symbols.

According to the conventions of geographical coordinate systems, positions are measured by latitude, longitude, and height (altitude). There are a number of celestial coordinate systems based on different fundamental planes and with different terms for the various coordinates. The spherical coordinate systems used in mathematics normally use radians rather than degrees—90 degrees equals π/2 radians. And these systems of the mathematics convention may measure the azimuthal angle counterclockwise (i.e., from the south direction x-axis or 180°, towards the east direction y-axis or +90°), rather than measure clockwise (from the north direction x-axis or 0°, towards the east direction y-axis or +90°) as done in the horizontal coordinate system. (See graphic re "mathematics convention".)

The spherical coordinate system of the physics convention can be seen as a generalization of the polar coordinate system in three-dimensional space. It can be further extended to higher-dimensional spaces, and is then referred to as a hyperspherical coordinate system.

## Definition

To define a spherical coordinate system, one must choose an origin point in space, O, and two orthogonal directions: the zenith direction and the azimuth reference direction. These choices determine a reference plane that is typically defined with x- and y-axes and which contains the point of origin—and which is perpendicular (orthogonal) to the zenith direction and is typically called "horizontal" to the zenith direction's "vertical". The spherical coordinates of a point P then are defined as follows:

• The radius or radial distance is the Euclidean distance from the origin O to P.
• The inclination (or polar angle) is the angle between the zenith direction and the line segment OP.
• The azimuth (or azimuthal angle) is the signed angle measured from the azimuth reference direction to the orthogonal projection of the line segment OP on the reference plane.

The sign of the azimuth is determined by choosing the rotation that designates the positive sense of turning about the zenith. This choice is arbitrary, and is part of the coordinate system definition.

The elevation angle is the signed angle between the (x-y) reference plane and the line segment OP, where positive angles are oriented towards the zenith. Equivalently, the elevation angle is 90 degrees (or π/2 radians) minus the inclination angle (polar angle). For example if the inclination angle is 60 degrees (or π/3 radians), then the elevation angle is 30 degrees (or π/6 radians). If the inclination angle is either zero or 180 degrees (or π radians), the azimuth is arbitrary. If the radius is zero, both azimuth and inclination are arbitrary.

In linear algebra, the vector from the origin O to the point P is often called the position vector of P.

### Conventions

Several different conventions exist for representing the three coordinates, and for the order in which they should be written. The use of ${\displaystyle (r,\theta ,\varphi )}$ to denote radial distance, inclination (or elevation), and azimuth, respectively, is common practice in physics, and is specified by ISO standard 80000-2:2019, and earlier in ISO 31-11 (1992).

This article, as stated above, will use the ISO convention, ${\displaystyle (r,\theta ,\varphi ),}$ gives the radial distance, polar angle, and azimuthal angle.

However, some authors (including mathematicians) use ρ for radial distance, φ for inclination (or elevation) and θ for azimuth, and r for radius from the z-axis, which "provides a logical extension of the usual polar coordinates notation". Some authors may also list the azimuth before the inclination (or elevation). Some combinations of these choices result in a left-handed coordinate system. The standard convention ${\displaystyle (r,\theta ,\varphi )}$ conflicts with the usual notation for two-dimensional polar coordinates and three-dimensional cylindrical coordinates, where θ is often used for the azimuth.

The angles are typically measured in degrees (°) or radians (rad), where 360° = 2π rad. Degrees are most common in geography, astronomy, and engineering, whereas radians are commonly used in mathematics and theoretical physics. The unit for radial distance is usually determined by the context.

When the system is used for physical three-space, it is customary to use positive sign for azimuth angles that are measured in the counter-clockwise sense from the reference direction on the reference plane, as seen from the zenith side of the plane. This convention is used, in particular, for geographical coordinates, where the "zenith" direction is north and positive azimuth (longitude) angles are measured eastwards from some prime meridian.

Major conventions
coordinates corresponding local geographical directions
(Z, X, Y)
right/left-handed
(r, θinc, φaz,right) (U, S, E) right
(r, φaz,right, θel) (U, E, N) right
(r, θel, φaz,right) (U, N, E) left

Note: easting (E), northing (N), upwardness (U). Local azimuth angle would be measured, e.g., counterclockwise from S to E in the case of (U, S, E).

### Unique coordinates

Any spherical coordinate triplet ${\displaystyle (r,\theta ,\varphi )}$ specifies a single point of three-dimensional space. On the other hand, every point has infinitely many equivalent spherical coordinates. One can add or subtract any number of full turns to either angular measure without changing the angles themselves, and therefore without changing the point. It is also convenient, in many contexts, to allow negative radial distances, with the convention that ${\displaystyle (-r,-\theta ,\varphi )}$ is equivalent to ${\displaystyle (r,\theta ,\varphi )}$ for any r, θ, and φ. Moreover, ${\displaystyle (r,-\theta ,\varphi )}$ is equivalent to ${\displaystyle (r,\theta ,\varphi {+}180^{\circ })}$.

If it is necessary to define a unique set of spherical coordinates for each point, one must restrict their ranges. A common choice is

• radial distance: r ≥ 0,
• polar angle: 0° ≤ θ ≤ 180° (π rad),
• azimuth : 0° ≤ φ < 360° (2π rad).

However, the azimuth φ is often restricted to the interval (−180°, +180°], or (−π, +π ] in radians, instead of [0, 360°). This is the standard convention for geographic longitude.

For the polar angle θ, the range [0°, 180°] for inclination is equivalent to [−90°, +90°] for elevation. In geography, the latitude is the elevation.

Even with these restrictions, if polar angle is 0° or 180° (elevation is 90° or −90°) then the azimuth angle is arbitrary; and if r is zero, both azimuth and polar angle are arbitrary. To make the coordinates unique, one can use the convention that in these cases the arbitrary coordinates are set to zero.

### Plotting

To plot a dot from its spherical coordinates (r, θ, φ), where θ is inclination, move r units from the origin in the zenith direction, rotate by θ about the origin towards the azimuth reference direction, and rotate by φ about the zenith in the proper direction.

## Applications

Just as the two-dimensional Cartesian coordinate system is useful on the plane, a two-dimensional spherical coordinate system is useful on the surface of a sphere. In this system, the sphere is taken as a unit sphere, so the radius is unity and can generally be ignored. This simplification can also be very useful when dealing with objects such as rotational matrices.

Spherical coordinates are useful in analyzing systems that have some degree of symmetry about a point, such as volume integrals inside a sphere, the potential energy field surrounding a concentrated mass or charge, or global weather simulation in a planet's atmosphere. A sphere that has the Cartesian equation x2 + y2 + z2 = c2 has the simple equation r = c in spherical coordinates.

Two important partial differential equations that arise in many physical problems, Laplace's equation and the Helmholtz equation, allow a separation of variables in spherical coordinates. The angular portions of the solutions to such equations take the form of spherical harmonics.

Another application is ergonomic design, where r is the arm length of a stationary person and the angles describe the direction of the arm as it reaches out.

Three dimensional modeling of loudspeaker output patterns can be used to predict their performance. A number of polar plots are required, taken at a wide selection of frequencies, as the pattern changes greatly with frequency. Polar plots help to show that many loudspeakers tend toward omnidirectionality at lower frequencies.

The spherical coordinate system is also commonly used in 3D game development to rotate the camera around the player's position

### In geography

To a first approximation, the geographic coordinate system uses elevation angle (latitude) in degrees north of the equator plane, in the range −90° ≤ φ ≤ 90°, instead of inclination. Latitude is either geocentric latitude, measured at the Earth's center and designated variously by ψ, q, φ′, φc, φg or geodetic latitude, measured by the observer's local vertical, and commonly designated φ. The polar angle, which is 90° minus the latitude and ranges from 0 to 180°, is called colatitude in geography.

The azimuth angle (longitude), commonly denoted by λ, is measured in degrees east or west from some conventional reference meridian (most commonly the IERS Reference Meridian), so its domain is −180° ≤ λ ≤ 180°. For positions on the Earth or other solid celestial body, the reference plane is usually taken to be the plane perpendicular to the axis of rotation.

Instead of the radial distance, geographers commonly use altitude above or below some reference surface (vertical datum), which may be the mean sea level. The radial distance r can be computed from the altitude by adding the radius of Earth, which is approximately 6,360 ± 11 km (3,952 ± 7 miles).

However, modern geographical coordinate systems are quite complex, and the positions implied by these simple formulae may be wrong by several kilometers. The precise standard meanings of latitude, longitude and altitude are currently defined by the World Geodetic System (WGS), and take into account the flattening of the Earth at the poles (about 21 km or 13 miles) and many other details.

Planetary coordinate systems use formulations analogous to the geographic coordinate system.

### In astronomy

A series of astronomical coordinate systems are used to measure the elevation angle from different fundamental planes. These reference planes are the observer's horizon, the celestial equator (defined by Earth's rotation), the plane of the ecliptic (defined by Earth's orbit around the Sun), the plane of the earth terminator (normal to the instantaneous direction to the Sun), and the galactic equator (defined by the rotation of the Milky Way).

## Coordinate system conversions

As the spherical coordinate system is only one of many three-dimensional coordinate systems, there exist equations for converting coordinates between the spherical coordinate system and others.

### Cartesian coordinates

The spherical coordinates of a point in the ISO convention (i.e. for physics: radius r, inclination θ, azimuth φ) can be obtained from its Cartesian coordinates (x, y, z) by the formulae

{\displaystyle {\begin{aligned}r&={\sqrt {x^{2}+y^{2}+z^{2}}}\\\theta &=\arccos {\frac {z}{\sqrt {x^{2}+y^{2}+z^{2}}}}=\arccos {\frac {z}{r}}={\begin{cases}\arctan {\frac {\sqrt {x^{2}+y^{2}}}{z}}&{\text{if }}z>0\\\pi +\arctan {\frac {\sqrt {x^{2}+y^{2}}}{z}}&{\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}}\\\varphi &=\operatorname {sgn}(y)\arccos {\frac {x}{\sqrt {x^{2}+y^{2}}}}={\begin{cases}\arctan({\frac {y}{x}})&{\text{if }}x>0,\\\arctan({\frac {y}{x}})+\pi &{\text{if }}x<0{\text{ and }}y\geq 0,\\\arctan({\frac {y}{x}})-\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}}}

The inverse tangent denoted in φ = arctan y/x must be suitably defined, taking into account the correct quadrant of (x, y). See the article on atan2.

Alternatively, the conversion can be considered as two sequential rectangular to polar conversions: the first in the Cartesian xy plane from (x, y) to (R, φ), where R is the projection of r onto the xy-plane, and the second in the Cartesian zR-plane from (z, R) to (r, θ). The correct quadrants for φ and θ are implied by the correctness of the planar rectangular to polar conversions.

These formulae assume that the two systems have the same origin, that the spherical reference plane is the Cartesian xy plane, that θ is inclination from the z direction, and that the azimuth angles are measured from the Cartesian x axis (so that the y axis has φ = +90°). If θ measures elevation from the reference plane instead of inclination from the zenith the arccos above becomes an arcsin, and the cos θ and sin θ below become switched.

Conversely, the Cartesian coordinates may be retrieved from the spherical coordinates (radius r, inclination θ, azimuth φ), where r[0, ∞), θ[0, π], φ[0, 2π), by

{\displaystyle {\begin{aligned}x&=r\sin \theta \,\cos \varphi ,\\y&=r\sin \theta \,\sin \varphi ,\\z&=r\cos \theta .\end{aligned}}}

### Cylindrical coordinates

Cylindrical coordinates (axial radius ρ, azimuth φ, elevation z) may be converted into spherical coordinates (central radius r, inclination θ, azimuth φ), by the formulas

{\displaystyle {\begin{aligned}r&={\sqrt {\rho ^{2}+z^{2}}},\\\theta &=\arctan {\frac {\rho }{z}}=\arccos {\frac {z}{\sqrt {\rho ^{2}+z^{2}}}},\\\varphi &=\varphi .\end{aligned}}}

Conversely, the spherical coordinates may be converted into cylindrical coordinates by the formulae

{\displaystyle {\begin{aligned}\rho &=r\sin \theta ,\\\varphi &=\varphi ,\\z&=r\cos \theta .\end{aligned}}}

These formulae assume that the two systems have the same origin and same reference plane, measure the azimuth angle φ in the same senses from the same axis, and that the spherical angle θ is inclination from the cylindrical z axis.

## Generalization

It is also possible to deal with ellipsoids in Cartesian coordinates by using a modified version of the spherical coordinates.

Let P be an ellipsoid specified by the level set

${\displaystyle ax^{2}+by^{2}+cz^{2}=d.}$

The modified spherical coordinates of a point in P in the ISO convention (i.e. for physics: radius r, inclination θ, azimuth φ) can be obtained from its Cartesian coordinates (x, y, z) by the formulae

{\displaystyle {\begin{aligned}x&={\frac {1}{\sqrt {a}}}r\sin \theta \,\cos \varphi ,\\y&={\frac {1}{\sqrt {b}}}r\sin \theta \,\sin \varphi ,\\z&={\frac {1}{\sqrt {c}}}r\cos \theta ,\\r^{2}&=ax^{2}+by^{2}+cz^{2}.\end{aligned}}}

An infinitesimal volume element is given by

${\displaystyle \mathrm {d} V=\left|{\frac {\partial (x,y,z)}{\partial (r,\theta ,\varphi )}}\right|\,dr\,d\theta \,d\varphi ={\frac {1}{\sqrt {abc}}}r^{2}\sin \theta \,\mathrm {d} r\,\mathrm {d} \theta \,\mathrm {d} \varphi ={\frac {1}{\sqrt {abc}}}r^{2}\,\mathrm {d} r\,\mathrm {d} \Omega .}$

The square-root factor comes from the property of the determinant that allows a constant to be pulled out from a column:

${\displaystyle {\begin{vmatrix}ka&b&c\\kd&e&f\\kg&h&i\end{vmatrix}}=k{\begin{vmatrix}a&b&c\\d&e&f\\g&h&i\end{vmatrix}}.}$

## Integration and differentiation in spherical coordinates

The following equations (Iyanaga 1977) assume that the colatitude θ is the inclination from the positive z axis, as in the physics convention discussed.

The line element for an infinitesimal displacement from (r, θ, φ) to (r + dr, θ + dθ, φ + dφ) is

${\displaystyle \mathrm {d} \mathbf {r} =\mathrm {d} r\,{\hat {\mathbf {r} }}+r\,\mathrm {d} \theta \,{\hat {\boldsymbol {\theta }}}+r\sin {\theta }\,\mathrm {d} \varphi \,\mathbf {\hat {\boldsymbol {\varphi }}} ,}$
where
{\displaystyle {\begin{aligned}{\hat {\mathbf {r} }}&=\sin \theta \cos \varphi \,{\hat {\mathbf {x} }}+\sin \theta \sin \varphi \,{\hat {\mathbf {y} }}+\cos \theta \,{\hat {\mathbf {z} }},\\{\hat {\boldsymbol {\theta }}}&=\cos \theta \cos \varphi \,{\hat {\mathbf {x} }}+\cos \theta \sin \varphi \,{\hat {\mathbf {y} }}-\sin \theta \,{\hat {\mathbf {z} }},\\{\hat {\boldsymbol {\varphi }}}&=-\sin \varphi \,{\hat {\mathbf {x} }}+\cos \varphi \,{\hat {\mathbf {y} }}\end{aligned}}}
are the local orthogonal unit vectors in the directions of increasing r, θ, and φ, respectively, and , ŷ, and are the unit vectors in Cartesian coordinates. The linear transformation to this right-handed coordinate triplet is a rotation matrix,
${\displaystyle R={\begin{pmatrix}\sin \theta \cos \varphi &\sin \theta \sin \varphi &{\hphantom {-}}\cos \theta \\\cos \theta \cos \varphi &\cos \theta \sin \varphi &-\sin \theta \\-\sin \varphi &\cos \varphi &{\hphantom {-}}0\end{pmatrix}}.}$

This gives the transformation from the spherical to the cartesian, the other way around is given by its inverse. Note: the matrix is an orthogonal matrix, that is, its inverse is simply its transpose.

The Cartesian unit vectors are thus related to the spherical unit vectors by:

${\displaystyle {\begin{bmatrix}\mathbf {\hat {x}} \\\mathbf {\hat {y}} \\\mathbf {\hat {z}} \end{bmatrix}}={\begin{bmatrix}\sin \theta \cos \varphi &\cos \theta \cos \varphi &-\sin \varphi \\\sin \theta \sin \varphi &\cos \theta \sin \varphi &{\hphantom {-}}\cos \varphi \\\cos \theta &-\sin \theta &{\hphantom {-}}0\end{bmatrix}}{\begin{bmatrix}{\boldsymbol {\hat {r}}}\\{\boldsymbol {\hat {\theta }}}\\{\boldsymbol {\hat {\varphi }}}\end{bmatrix}}}$

The general form of the formula to prove the differential line element, is

${\displaystyle \mathrm {d} \mathbf {r} =\sum _{i}{\frac {\partial \mathbf {r} }{\partial x_{i}}}\,\mathrm {d} x_{i}=\sum _{i}\left|{\frac {\partial \mathbf {r} }{\partial x_{i}}}\right|{\frac {\frac {\partial \mathbf {r} }{\partial x_{i}}}{\left|{\frac {\partial \mathbf {r} }{\partial x_{i}}}\right|}}\,\mathrm {d} x_{i}=\sum _{i}\left|{\frac {\partial \mathbf {r} }{\partial x_{i}}}\right|\,\mathrm {d} x_{i}\,{\hat {\boldsymbol {x}}}_{i},}$
that is, the change in ${\displaystyle \mathbf {r} }$ is decomposed into individual changes corresponding to changes in the individual coordinates.

To apply this to the present case, one needs to calculate how ${\displaystyle \mathbf {r} }$ changes with each of the coordinates. In the conventions used,

${\displaystyle \mathbf {r} ={\begin{bmatrix}r\sin \theta \,\cos \varphi \\r\sin \theta \,\sin \varphi \\r\cos \theta \end{bmatrix}}.}$

Thus,

${\displaystyle {\frac {\partial \mathbf {r} }{\partial r}}={\begin{bmatrix}\sin \theta \,\cos \varphi \\\sin \theta \,\sin \varphi \\\cos \theta \end{bmatrix}}=\mathbf {\hat {r}} ,\quad {\frac {\partial \mathbf {r} }{\partial \theta }}={\begin{bmatrix}r\cos \theta \,\cos \varphi \\r\cos \theta \,\sin \varphi \\-r\sin \theta \end{bmatrix}}=r\,{\hat {\boldsymbol {\theta }}},\quad {\frac {\partial \mathbf {r} }{\partial \varphi }}={\begin{bmatrix}-r\sin \theta \,\sin \varphi \\{\hphantom {-}}r\sin \theta \,\cos \varphi \\0\end{bmatrix}}=r\sin \theta \,\mathbf {\hat {\boldsymbol {\varphi }}} .}$

The desired coefficients are the magnitudes of these vectors:

${\displaystyle \left|{\frac {\partial \mathbf {r} }{\partial r}}\right|=1,\quad \left|{\frac {\partial \mathbf {r} }{\partial \theta }}\right|=r,\quad \left|{\frac {\partial \mathbf {r} }{\partial \varphi }}\right|=r\sin \theta .}$

The surface element spanning from θ to θ + dθ and φ to φ + dφ on a spherical surface at (constant) radius r is then

${\displaystyle \mathrm {d} S_{r}=\left\|{\frac {\partial {\mathbf {r} }}{\partial \theta }}\times {\frac {\partial {\mathbf {r} }}{\partial \varphi }}\right\|\mathrm {d} \theta \,\mathrm {d} \varphi =\left|r{\hat {\boldsymbol {\theta }}}\times r\sin \theta {\boldsymbol {\hat {\varphi }}}\right|=r^{2}\sin \theta \,\mathrm {d} \theta \,\mathrm {d} \varphi ~.}$

Thus the differential solid angle is

${\displaystyle \mathrm {d} \Omega ={\frac {\mathrm {d} S_{r}}{r^{2}}}=\sin \theta \,\mathrm {d} \theta \,\mathrm {d} \varphi .}$

The surface element in a surface of polar angle θ constant (a cone with vertex the origin) is

${\displaystyle \mathrm {d} S_{\theta }=r\sin \theta \,\mathrm {d} \varphi \,\mathrm {d} r.}$

The surface element in a surface of azimuth φ constant (a vertical half-plane) is

${\displaystyle \mathrm {d} S_{\varphi }=r\,\mathrm {d} r\,\mathrm {d} \theta .}$

The volume element spanning from r to r + dr, θ to θ + dθ, and φ to φ + dφ is specified by the determinant of the Jacobian matrix of partial derivatives,

${\displaystyle J={\frac {\partial (x,y,z)}{\partial (r,\theta ,\varphi )}}={\begin{pmatrix}\sin \theta \cos \varphi &r\cos \theta \cos \varphi &-r\sin \theta \sin \varphi \\\sin \theta \sin \varphi &r\cos \theta \sin \varphi &{\hphantom {-}}r\sin \theta \cos \varphi \\\cos \theta &-r\sin \theta &{\hphantom {-}}0\end{pmatrix}},}$
namely
${\displaystyle \mathrm {d} V=\left|{\frac {\partial (x,y,z)}{\partial (r,\theta ,\varphi )}}\right|\,\mathrm {d} r\,\mathrm {d} \theta \,\mathrm {d} \varphi =r^{2}\sin \theta \,\mathrm {d} r\,\mathrm {d} \theta \,\mathrm {d} \varphi =r^{2}\,\mathrm {d} r\,\mathrm {d} \Omega ~.}$

Thus, for example, a function f(r, θ, φ) can be integrated over every point in R3 by the triple integral

${\displaystyle \int \limits _{0}^{2\pi }\int \limits _{0}^{\pi }\int \limits _{0}^{\infty }f(r,\theta ,\varphi )r^{2}\sin \theta \,\mathrm {d} r\,\mathrm {d} \theta \,\mathrm {d} \varphi ~.}$

The del operator in this system leads to the following expressions for the gradient, divergence, curl and (scalar) Laplacian,

{\displaystyle {\begin{aligned}\nabla f={}&{\partial f \over \partial r}{\hat {\mathbf {r} }}+{1 \over r}{\partial f \over \partial \theta }{\hat {\boldsymbol {\theta }}}+{1 \over r\sin \theta }{\partial f \over \partial \varphi }{\hat {\boldsymbol {\varphi }}},\\[8pt]\nabla \cdot \mathbf {A} ={}&{\frac {1}{r^{2}}}{\partial \over \partial r}\left(r^{2}A_{r}\right)+{\frac {1}{r\sin \theta }}{\partial \over \partial \theta }\left(\sin \theta A_{\theta }\right)+{\frac {1}{r\sin \theta }}{\partial A_{\varphi } \over \partial \varphi },\\[8pt]\nabla \times \mathbf {A} ={}&{\frac {1}{r\sin \theta }}\left({\partial \over \partial \theta }\left(A_{\varphi }\sin \theta \right)-{\partial A_{\theta } \over \partial \varphi }\right){\hat {\mathbf {r} }}\\[8pt]&{}+{\frac {1}{r}}\left({1 \over \sin \theta }{\partial A_{r} \over \partial \varphi }-{\partial \over \partial r}\left(rA_{\varphi }\right)\right){\hat {\boldsymbol {\theta }}}\\[8pt]&{}+{\frac {1}{r}}\left({\partial \over \partial r}\left(rA_{\theta }\right)-{\partial A_{r} \over \partial \theta }\right){\hat {\boldsymbol {\varphi }}},\\[8pt]\nabla ^{2}f={}&{1 \over r^{2}}{\partial \over \partial r}\left(r^{2}{\partial f \over \partial r}\right)+{1 \over r^{2}\sin \theta }{\partial \over \partial \theta }\left(\sin \theta {\partial f \over \partial \theta }\right)+{1 \over r^{2}\sin ^{2}\theta }{\partial ^{2}f \over \partial \varphi ^{2}}\\[8pt]={}&\left({\frac {\partial ^{2}}{\partial r^{2}}}+{\frac {2}{r}}{\frac {\partial }{\partial r}}\right)f+{1 \over r^{2}\sin \theta }{\partial \over \partial \theta }\left(\sin \theta {\frac {\partial }{\partial \theta }}\right)f+{\frac {1}{r^{2}\sin ^{2}\theta }}{\frac {\partial ^{2}}{\partial \varphi ^{2}}}f~.\end{aligned}}}

Further, the inverse Jacobian in Cartesian coordinates is

${\displaystyle J^{-1}={\begin{pmatrix}{\dfrac {x}{r}}&{\dfrac {y}{r}}&{\dfrac {z}{r}}\\\\{\dfrac {xz}{r^{2}{\sqrt {x^{2}+y^{2}}}}}&{\dfrac {yz}{r^{2}{\sqrt {x^{2}+y^{2}}}}}&{\dfrac {-(x^{2}+y^{2})}{r^{2}{\sqrt {x^{2}+y^{2}}}}}\\\\{\dfrac {-y}{x^{2}+y^{2}}}&{\dfrac {x}{x^{2}+y^{2}}}&0\end{pmatrix}}.}$
The metric tensor in the spherical coordinate system is ${\displaystyle g=J^{T}J}$.

## Distance in spherical coordinates

In spherical coordinates, given two points with φ being the azimuthal coordinate

{\displaystyle {\begin{aligned}{\mathbf {r} }&=(r,\theta ,\varphi ),\\{\mathbf {r} '}&=(r',\theta ',\varphi ')\end{aligned}}}
The distance between the two points can be expressed as
{\displaystyle {\begin{aligned}{\mathbf {D} }&={\sqrt {r^{2}+r'^{2}-2rr'(\sin {\theta }\sin {\theta '}\cos {(\varphi -\varphi ')}+\cos {\theta }\cos {\theta '})}}\end{aligned}}}

## Kinematics

In spherical coordinates, the position of a point or particle (although better written as a triple${\displaystyle (r,\theta ,\varphi )}$) can be written as

${\displaystyle \mathbf {r} =r\mathbf {\hat {r}} .}$
Its velocity is then
${\displaystyle \mathbf {v} ={\frac {\mathrm {d} \mathbf {r} }{\mathrm {d} t}}={\dot {r}}\mathbf {\hat {r}} +r\,{\dot {\theta }}\,{\hat {\boldsymbol {\theta }}}+r\,{\dot {\varphi }}\sin \theta \,\mathbf {\hat {\boldsymbol {\varphi }}} }$
and its acceleration is
{\displaystyle {\begin{aligned}\mathbf {a} ={\frac {\mathrm {d} \mathbf {v} }{\mathrm {d} t}}={}&\left({\ddot {r}}-r\,{\dot {\theta }}^{2}-r\,{\dot {\varphi }}^{2}\sin ^{2}\theta \right)\mathbf {\hat {r}} \\&{}+\left(r\,{\ddot {\theta }}+2{\dot {r}}\,{\dot {\theta }}-r\,{\dot {\varphi }}^{2}\sin \theta \cos \theta \right){\hat {\boldsymbol {\theta }}}\\&{}+\left(r{\ddot {\varphi }}\,\sin \theta +2{\dot {r}}\,{\dot {\varphi }}\,\sin \theta +2r\,{\dot {\theta }}\,{\dot {\varphi }}\,\cos \theta \right){\hat {\boldsymbol {\varphi }}}\end{aligned}}}

The angular momentum is

${\displaystyle \mathbf {L} =\mathbf {r} \times \mathbf {p} =\mathbf {r} \times m\mathbf {v} =mr^{2}(-{\dot {\varphi }}\sin \theta \,\mathbf {\hat {\boldsymbol {\theta }}} +{\dot {\theta }}\,{\hat {\boldsymbol {\varphi }}})}$
Where ${\displaystyle m}$ is mass. In the case of a constant φ or else θ = π/2, this reduces to vector calculus in polar coordinates.

The corresponding angular momentum operator then follows from the phase-space reformulation of the above,

${\displaystyle \mathbf {L} =-i\hbar ~\mathbf {r} \times \nabla =i\hbar \left({\frac {\hat {\boldsymbol {\theta }}}{\sin(\theta )}}{\frac {\partial }{\partial \phi }}-{\hat {\boldsymbol {\phi }}}{\frac {\partial }{\partial \theta }}\right).}$

The torque is given as

${\displaystyle \mathbf {\tau } ={\frac {\mathrm {d} \mathbf {L} }{\mathrm {d} t}}=\mathbf {r} \times \mathbf {F} =-m\left(2r{\dot {r}}{\dot {\varphi }}\sin \theta +r^{2}{\ddot {\varphi }}\sin {\theta }+2r^{2}{\dot {\theta }}{\dot {\varphi }}\cos {\theta }\right){\hat {\boldsymbol {\theta }}}+m\left(r^{2}{\ddot {\theta }}+2r{\dot {r}}{\dot {\theta }}-r^{2}{\dot {\varphi }}^{2}\sin \theta \cos \theta \right){\hat {\boldsymbol {\varphi }}}}$

The kinetic energy is given as

${\displaystyle E_{k}={\frac {1}{2}}m\left[\left({\dot {r}}^{2}\right)+\left(r{\dot {\theta }}\right)^{2}+\left(r{\dot {\varphi }}\sin \theta \right)^{2}\right]}$