Dynamics/Kinematics/Coordinate Systems/Spherical

Introduction
A spherical coordinate system is also useful for describing motion.

Material taken from Vector fields in cylindrical and spherical coordinates

Position


Vectors are defined in spherical coordinates by (r, θ, φ), where
 * r is the length of the vector,
 * θ is the angle between the positive Z-axis and the vector in question (0 ≤ θ ≤ π), and
 * φ is the angle between the projection of the vector onto the X-Y-plane and the positive X-axis (0 ≤ φ < 2π).

(r, θ, φ) is given in Cartesian coordinates by:


 * $$\begin{bmatrix}r \\ \theta \\ \phi \end{bmatrix} =

\begin{bmatrix} \sqrt{x^2 + y^2 + z^2} \\ \arccos(z / r) \\ \arctan(y / x) \end{bmatrix},\ \ \ 0 \le \theta \le \pi,\ \ \ 0 \le \phi < 2\pi, $$

or inversely by:


 * $$\begin{bmatrix} x \\ y \\ z \end{bmatrix} =

\begin{bmatrix} r\sin\theta\cos\phi \\ r\sin\theta\sin\phi \\ r\cos\theta\end{bmatrix}.$$

Any vector field can be written in terms of the unit vectors as:
 * $$\mathbf A = A_x\mathbf{\hat x} + A_y\mathbf{\hat y} + A_z\mathbf{\hat z}

= A_r\boldsymbol{\hat r} + A_\theta\boldsymbol{\hat \theta} + A_\phi\boldsymbol{\hat \phi}$$ The spherical unit vectors are related to the cartesian unit vectors by:
 * $$\begin{bmatrix}\boldsymbol{\hat{r}} \\ \boldsymbol{\hat\theta} \\ \boldsymbol{\hat\phi} \end{bmatrix}

= \begin{bmatrix} \sin\theta\cos\phi & \sin\theta\sin\phi & \cos\theta \\ \cos\theta\cos\phi & \cos\theta\sin\phi & -\sin\theta \\ -\sin\phi         & \cos\phi           & 0 \end{bmatrix} \begin{bmatrix} \mathbf{\hat x} \\ \mathbf{\hat y} \\ \mathbf{\hat z} \end{bmatrix}$$

Note: the matrix is an orthogonal matrix, that is, its inverse is simply its transpose.

So the cartesian unit vectors are related to the spherical unit vectors by:
 * $$\begin{bmatrix}\mathbf{\hat x} \\ \mathbf{\hat y} \\ \mathbf{\hat z} \end{bmatrix}

= \begin{bmatrix} \sin\theta\cos\phi & \cos\theta\cos\phi & -\sin\phi \\ \sin\theta\sin\phi & \cos\theta\sin\phi & \cos\phi \\ \cos\theta        & -\sin\theta        & 0 \end{bmatrix} \begin{bmatrix} \boldsymbol{\hat{r}} \\ \boldsymbol{\hat\theta} \\ \boldsymbol{\hat\phi} \end{bmatrix}$$