# User:Jacobolus/coordinates

This article describes some of the common coordinate systems that appear in elementary mathematics. For advanced topics, please refer to coordinate system. For more background, see Cartesian coordinate system.

The coordinates of a point are the components of an n-tuple of numbers used to represent the location of the point in the plane or space. A coordinate system is a plane or space where the origin and axes are defined so that coordinates can be measured.

## Cartesian coordinates

In the two-dimensional Cartesian coordinate system, a point ${\displaystyle P}$ in the ${\displaystyle xy}$-plane is represent by a 2-tuple or ordered pair of components ${\displaystyle (x,y)}$.

In the three-dimensional Cartesian coordinate system, a point ${\displaystyle P}$ in the ${\displaystyle xyz}$-space is represent by a 3-tuple or triple of components ${\displaystyle (x,y,z)}$.

## Polar coordinates

The polar coordinate systems are coordinate systems in which a point is identified by a distance from some fixed feature in space and one or more subtended angles.

The term polar coordinates often refers to circular coordinates (two-dimensional). Other commonly used polar coordinates are cylindrical coordinates and spherical coordinates (both three-dimensional).

NOTE: Two different conventions are used to label the coordinates in these coordinate systems. In mathematics, the symbols ${\displaystyle \theta }$ and ${\displaystyle \phi }$ used below are commonly switched, as are the symbols ${\displaystyle r}$ and ${\displaystyle \rho }$. In Wikipedia, for consistency, we will adhere to the conventions used in physics.

### Circular coordinates

The circular coordinate system, often referred to as the polar coordinate system, is a two-dimensional polar coordinate system, defined by an origin, ${\displaystyle O}$, and a semi-infinite line ${\displaystyle L}$ leading from this point. ${\displaystyle L}$ is also called the polar axis. In terms of the Cartesian coordinate system, one usually picks ${\displaystyle O}$ to be the origin ${\displaystyle (0,0)}$ and ${\displaystyle L}$ to be the positive ${\displaystyle x}$-axis (the right half of the ${\displaystyle x}$-axis).

In the circular coordinate system, a point ${\displaystyle P}$ is represented by an ordered pair of components ${\displaystyle (r,\phi )}$. Using terms of the Cartesian coordinate system,

### Cylindrical coordinates

The cylindrical coordinate system is a three-dimensional polar coordinate system.

In the cylindrical coordinate system, a point P is represented by a tuple of three components ${\displaystyle (r,\phi ,z)}$. Using terms of the Cartesian coordinate system,

Note: some sources use ${\displaystyle h}$ for ${\displaystyle z}$; there is no "right" or "wrong" convention, but in wikipedia we will follow that commonly used in physics.

Cylindrical coordinates involve some redundancy; ${\displaystyle \phi }$ loses its significance if ${\displaystyle r=0}$.

Cylindrical coordinates are useful in analyzing systems that are symmetrical about an axis. For example the infinitely long cylinder that has the Cartesian equation ${\displaystyle x^{2}+y^{2}=c^{2}}$ has the very simple equation ${\displaystyle r=c}$ in cylindrical coordinates.

### Spherical coordinates

The spherical coordinate system is a three-dimensional polar coordinate system.

In the spherical coordinate system, a point ${\displaystyle P}$ is represented by a tuple of three components ${\displaystyle (r,\theta ,\phi )}$. Using terms of the Cartesian coordinate system,

Note: mathematics textbooks commonly interchange the symbols ${\displaystyle \phi }$ and ${\displaystyle \theta }$ relative to this article, or use ${\displaystyle \rho }$ for ${\displaystyle r}$; the convention used here is that most common in physics.

The spherical coordinate system also involves some redundancy; ${\displaystyle \theta }$ loses its significance if ${\displaystyle r=0}$, and ${\displaystyle \phi }$ loses its significance if ${\displaystyle r=0}$ or ${\displaystyle \theta =0}$ or ${\displaystyle \theta =180^{\circ }}$.

To construct a point from its spherical coordinates: from the origin, go ${\displaystyle r}$ along the positive ${\displaystyle z}$-axis, rotate ${\displaystyle \theta }$ about the ${\displaystyle y}$-axis toward the direction of the positive ${\displaystyle x}$-axis, then rotate ${\displaystyle \phi }$ about the ${\displaystyle z}$-axis toward the direction of the positive ${\displaystyle y}$-axis.

Spherical coordinates are useful in analyzing systems that are symmetrical about a point; a sphere that has the Cartesian equation ${\displaystyle x^{2}+y^{2}+z^{2}=c^{2}}$ has the very simple equation ${\displaystyle r=c}$ in spherical coordinates.

Spherical coordinates are the natural coordinates for physical situations where there is spherical symmetry. In such a situation, one can describe waves using spherical harmonics. Another application is ergonomic design, where ${\displaystyle r}$ is the arm length of a stationary person and the angles describe the direction of the arm as it reaches out.

The concept of spherical coordinates can be extended to higher dimensional spaces and are then referred to as hyperspherical coordinates.

## Conversion between coordinate systems

### Cartesian and circular

${\displaystyle x=r\,\cos \phi \quad }$
${\displaystyle y=r\,\sin \phi \quad }$
${\displaystyle r={\sqrt {x^{2}+y^{2}}}}$
${\displaystyle \phi =\operatorname {atan2} (y,x)=\arctan {\frac {y}{x}}+\pi u_{0}(-x)\,\operatorname {sgn} y}$

where ${\displaystyle u_{0}}$ is the Heaviside step function with ${\displaystyle u_{0}(0)=0}$ and sgn is the signum function. Here the ${\displaystyle u_{0}}$ and sgn functions are being used as "logical" switches which are used as shorthand substitutes for several if ... then statements. Some computer languages include a bivariate arctangent function atan2(y,x) which finds the value for ${\displaystyle \phi }$ in the correct quadrant given ${\displaystyle x}$ and ${\displaystyle y}$.

### Cartesian and cylindrical

${\displaystyle x=\rho \,\cos \phi }$
${\displaystyle y=\rho \,\sin \phi }$
${\displaystyle z=z\quad }$
${\displaystyle \rho ={\sqrt {x^{2}+y^{2}}}}$
${\displaystyle \phi =\arctan {\frac {y}{x}}+\pi u_{0}(-x)\,\operatorname {sgn} y}$
${\displaystyle z=z\quad }$
${\displaystyle {\begin{bmatrix}dx\\dy\\dz\end{bmatrix}}={\begin{bmatrix}\cos \phi &-\rho \sin \phi &0\\\sin \phi &\rho \cos \phi &0\\0&0&1\end{bmatrix}}{\begin{bmatrix}d\rho \\d\phi \\dz\end{bmatrix}}}$
${\displaystyle {\begin{bmatrix}d\rho \\d\phi \\dz\end{bmatrix}}={\begin{bmatrix}{\frac {x}{\sqrt {x^{2}+y^{2}}}}&{\frac {y}{\sqrt {x^{2}+y^{2}}}}&0\\{\frac {-y}{x^{2}+y^{2}}}&{\frac {x}{x^{2}+y^{2}}}&0\\0&0&1\end{bmatrix}}{\begin{bmatrix}dx\\dy\\dz\end{bmatrix}}}$

### Cartesian and spherical

${\displaystyle x=r\,\sin \theta \,\cos \phi \quad }$
${\displaystyle y=r\,\sin \theta \,\sin \phi \quad }$
${\displaystyle z=r\,\cos \theta \quad }$
${\displaystyle r={\sqrt {x^{2}+y^{2}+z^{2}}}}$
${\displaystyle \theta =\arccos {\frac {z}{r}}=\arctan {\frac {\sqrt {x^{2}+y^{2}}}{z}}}$
${\displaystyle \phi =\arctan {\frac {y}{x}}+\pi \,u_{0}(-x)\,\operatorname {sgn} y}$
${\displaystyle {\begin{bmatrix}dx\\dy\\dz\end{bmatrix}}={\begin{bmatrix}\sin \theta \cos \phi &r\cos \theta \cos \phi &-r\sin \theta \sin \phi \\\sin \theta \sin \phi &r\cos \theta \sin \phi &r\sin \theta \cos \phi \\\cos \theta &-r\sin \theta &0\end{bmatrix}}{\begin{bmatrix}dt\\d\theta \\d\phi \end{bmatrix}}}$
${\displaystyle {\begin{bmatrix}dr\\d\theta \\d\phi \end{bmatrix}}={\begin{bmatrix}{\frac {x}{r}}&{\frac {y}{r}}&{\frac {z}{r}}\\{\frac {xz}{r^{2}{\sqrt {x^{2}+y^{2}}}}}&{\frac {yz}{r^{2}{\sqrt {x^{2}+y^{2}}}}}&{\frac {-(x^{2}+y^{2})}{r^{2}{\sqrt {x^{2}+y^{2}}}}}\\{\frac {-y}{x^{2}+y^{2}}}&{\frac {x}{x^{2}+y^{2}}}&0\end{bmatrix}}{\begin{bmatrix}dx\\dy\\dz\end{bmatrix}}}$

### Cylindrical and spherical

${\displaystyle \rho =r\,\sin \theta }$
${\displaystyle \phi =\phi \quad }$
${\displaystyle z=r\,\cos \theta }$
${\displaystyle r={\sqrt {\rho ^{2}+z^{2}}}}$
${\displaystyle \theta =\arctan {\frac {z}{\rho }}+\pi \,u_{0}(-\rho )\,\operatorname {sgn} z}$
${\displaystyle \phi =\phi \quad }$
${\displaystyle {\begin{bmatrix}dr\\d\phi \\dz\end{bmatrix}}={\begin{bmatrix}\sin \theta &r\cos \theta &0\\0&0&1\\\cos \theta &-r\sin \theta &0\end{bmatrix}}{\begin{bmatrix}dr\\d\theta \\d\phi \end{bmatrix}}}$
${\displaystyle {\begin{bmatrix}dr\\d\theta \\d\phi \end{bmatrix}}={\begin{bmatrix}{\frac {\rho }{\sqrt {\rho ^{2}+z^{2}}}}&0&{\frac {z}{\sqrt {\rho ^{2}+z^{2}}}}\\{\frac {-z}{\rho ^{2}+z^{2}}}&0&{\frac {\rho }{\rho ^{2}+z^{2}}}\\0&1&0\end{bmatrix}}{\begin{bmatrix}d\rho \\d\phi \\dz\end{bmatrix}}}$