# List of common coordinate transformations

This is a list of some of the most commonly used coordinate transformations.

## 2-Dimensional

Let (x, y) be the standard Cartesian coordinates, and r and θ the standard polar coordinates.

### From polar coordinates to Cartesian coordinates

${\displaystyle x=r\,\cos \theta \quad }$
${\displaystyle y=r\,\sin \theta \quad }$
${\displaystyle {\frac {\partial (x,y)}{\partial (r,\theta )}}={\begin{pmatrix}\cos \theta &-r\,\sin \theta \\\sin \theta &r\,\cos \theta \end{pmatrix}}}$
${\displaystyle \det {\frac {\partial (x,y)}{\partial (r,\theta )}}=r}$

### To polar coordinates from Cartesian coordinates

${\displaystyle r={\sqrt {x^{2}+y^{2}}}}$
${\displaystyle \theta ^{\prime }=\arctan \left|{\frac {y}{x}}\right|}$

Note: solving for ${\displaystyle \theta ^{\prime }}$ returns the resultant angle in the first quadrant (${\displaystyle 0<\theta <{\frac {\pi }{2}}}$). To find ${\displaystyle \theta }$, one must refer to the original Cartesian coordinate, determine the quadrant in which ${\displaystyle \theta }$ lies (ex (3,-3) [Cartesian] lies in QIV), then use the following to solve for ${\displaystyle \theta }$:

For ${\displaystyle \theta ^{\prime }}$ in QI:
${\displaystyle \theta =\theta ^{\prime }}$
For ${\displaystyle \theta ^{\prime }}$ in QII:
${\displaystyle \theta =\pi -\theta ^{\prime }}$
For ${\displaystyle \theta ^{\prime }}$ in QIII:
${\displaystyle \theta =\pi +\theta ^{\prime }}$
For ${\displaystyle \theta ^{\prime }}$ in QIV:
${\displaystyle \theta =2\pi -\theta ^{\prime }}$

The value for ${\displaystyle \theta }$ must be solved for in this manner because for all values of ${\displaystyle \theta }$, ${\displaystyle \tan \theta }$ is only defined for ${\displaystyle -{\frac {\pi }{2}}<\theta <+{\frac {\pi }{2}}}$, and is periodic (with period ${\displaystyle \pi }$). This means that the inverse function will only give values in the domain of the function, but restricted to a single period. Hence, the range of the inverse function is only half a full circle.

Note that one can also use

${\displaystyle r={\sqrt {x^{2}+y^{2}}}}$
${\displaystyle \theta ^{\prime }=2\arctan {\frac {y}{x+r}}}$

### To Cartesian coordinates from log-polar coordinates

Main article: Log-polar coordinates
${\displaystyle {\begin{cases}x=e^{\rho }\cos \theta ,\\y=e^{\rho }\sin \theta .\end{cases}}}$

By using complex numbers ${\displaystyle (x,y)=x+iy'}$, the transformation can be written as

${\displaystyle x+iy=e^{\rho +i\theta }\,}$

i.e. it is given by the complex exponential function.

### To log-polar coordinates from Cartesian coordinates

${\displaystyle {\begin{cases}\rho =\log {\sqrt {x^{2}+y^{2}}},\\\theta =\arctan {\frac {y}{x}}.\end{cases}}}$

### To Cartesian coordinates from bipolar coordinates

Main article: bipolar coordinates
${\displaystyle x=a\ {\frac {\sinh \tau }{\cosh \tau -\cos \sigma }}}$
${\displaystyle y=a\ {\frac {\sin \sigma }{\cosh \tau -\cos \sigma }}}$

### To Cartesian coordinates from two-center bipolar coordinates

${\displaystyle x={\frac {r_{1}^{2}-r_{2}^{2}}{4c}}}$
${\displaystyle y=\pm {\frac {1}{4c}}{\sqrt {16c^{2}r_{1}^{2}-(r_{1}^{2}-r_{2}^{2}+4c^{2})^{2}}}}$

### To polar coordinates from two-center bipolar coordinates

${\displaystyle r={\sqrt {\frac {r_{1}^{2}+r_{2}^{2}-2c^{2}}{2}}}}$
${\displaystyle \theta =\arctan \left[{\sqrt {{\frac {8c^{2}(r_{1}^{2}+r_{2}^{2}-2c^{2})}{r_{1}^{2}-r_{2}^{2}}}-1}}\right]}$

Where 2c is the distance between the poles.

### To Cartesian coordinates from Cesàro equation

Main article: Cesàro equation
${\displaystyle x=\int \cos \left[\int \kappa (s)\,ds\right]ds}$
${\displaystyle y=\int \sin \left[\int \kappa (s)\,ds\right]ds}$

### Arc length and curvature from Cartesian coordinates

${\displaystyle \kappa ={\frac {x'y''-y'x''}{(x'^{2}+y'^{2})^{3/2}}}}$

${\displaystyle s=\int _{a}^{t}{\sqrt {x'^{2}+y'^{2}}}\,dt}$

### Arc length and curvature from polar coordinates

${\displaystyle \kappa ={\frac {r^{2}+2r'^{2}-rr''}{(r^{2}+r'^{2})^{3/2}}}}$

${\displaystyle s=\int _{a}^{\phi }{\sqrt {r^{2}+r'^{2}}}\,d\phi }$

## 3-Dimensional

Let (x, y, z) be the standard Cartesian coordinates, and (ρ, θ, φ) the spherical coordinates, with θ the angle measured away from the +Z axis (as [1], see conventions in spherical coordinates). As φ has a range of 360° the same considerations as in polar (2 dimensional) coordinates apply whenever an arctangent of it is taken. θ has a range of 180°, running from 0° to 180°, and does not pose any problem when calculated from an arccosine, but beware for an arctangent. If, in the alternative definition, θ is chosen to run from −90° to +90°, in opposite direction of the earlier definition, it can be found uniquely from an arcsine, but beware of an arccotangent. In this case in all formulas below all arguments in θ should have sine and cosine exchanged, and as derivative also a plus and minus exchanged.

All divisions by zero result in special cases of being directions along one of the main axes and are in practice most easily solved by observation.

### To Cartesian coordinates

#### From spherical coordinates

Main article: spherical coordinates
${\displaystyle {x}=\rho \,\sin \theta \,\cos \phi \quad }$
${\displaystyle {y}=\rho \,\sin \theta \,\sin \phi \quad }$
${\displaystyle {z}=\rho \,\cos \theta \quad }$
${\displaystyle {\frac {\partial (x,y,z)}{\partial (\rho ,\theta ,\phi )}}={\begin{pmatrix}\sin \theta \cos \phi &\rho \cos \theta \cos \phi &-\rho \sin \theta \sin \phi \\\sin \theta \sin \phi &\rho \cos \theta \sin \phi &\rho \sin \theta \cos \phi \\\cos \theta &-\rho \sin \theta &0\end{pmatrix}}}$

So for the volume element:

${\displaystyle dx\;dy\;dz=\det {\frac {\partial (x,y,z)}{\partial (\rho ,\theta ,\phi )}}d\rho \;d\theta \;d\phi =\rho ^{2}\sin \theta \;d\rho \;d\theta \;d\phi \;}$

#### From cylindrical coordinates

${\displaystyle {x}={r}\,\cos \theta }$
${\displaystyle {y}={r}\,\sin \theta }$
${\displaystyle {z}={h}\,}$
${\displaystyle {\frac {\partial (x,y,z)}{\partial (r,\theta ,h)}}={\begin{pmatrix}\cos \theta &-r\sin \theta &0\\\sin \theta &r\cos \theta &0\\0&0&1\end{pmatrix}}}$

So for the volume element:

${\displaystyle dx\;dy\;dz=\det {\frac {\partial (x,y,z)}{\partial (r,\theta ,h)}}dr\;d\theta \;dh={r}\;dr\;d\theta \;dh\;}$

### To Spherical coordinates

#### From Cartesian coordinates

${\displaystyle {\rho }={\sqrt {x^{2}+y^{2}+z^{2}}}}$
${\displaystyle {\theta }=\arctan \left({\frac {\sqrt {x^{2}+y^{2}}}{z}}\right)=\arccos \left({\frac {z}{\sqrt {x^{2}+y^{2}+z^{2}}}}\right)}$
${\displaystyle {\phi }=\arctan \left({\frac {y}{x}}\right)=\arccos \left({\frac {x}{\sqrt {x^{2}+y^{2}}}}\right)=\arcsin \left({\frac {y}{\sqrt {x^{2}+y^{2}}}}\right)}$
${\displaystyle {\begin{pmatrix}{\frac {x}{\rho }}&{\frac {y}{\rho }}&{\frac {z}{\rho }}\\{\frac {xz}{\rho ^{2}{\sqrt {x^{2}+y^{2}}}}}&{\frac {yz}{\rho ^{2}{\sqrt {x^{2}+y^{2}}}}}&-{\frac {\sqrt {x^{2}+y^{2}}}{\rho ^{2}}}\\{\frac {-y}{x^{2}+y^{2}}}&{\frac {x}{x^{2}+y^{2}}}&0\\\end{pmatrix}}}$

So for the volume element:

${\displaystyle d\rho \ d\theta \ d\phi =\det {\frac {\partial (\rho ,\theta ,\phi )}{\partial (x,y,z)}}dx\ dy\ dz={\frac {1}{{\sqrt {x^{2}+y^{2}}}{\sqrt {x^{2}+y^{2}+z^{2}}}}}dx\ dy\ dz}$

#### From cylindrical coordinates

${\displaystyle {\rho }={\sqrt {r^{2}+h^{2}}}}$
${\displaystyle {\theta }=\arctan {\frac {r}{h}}}$
${\displaystyle {\phi }=\phi \quad }$
${\displaystyle {\frac {\partial (\rho ,\theta ,\phi )}{\partial (r,h,\phi )}}={\begin{pmatrix}{\frac {r}{\sqrt {r^{2}+h^{2}}}}&{\frac {h}{\sqrt {r^{2}+h^{2}}}}&0\\{\frac {h}{r^{2}+h^{2}}}&{\frac {-r}{r^{2}+h^{2}}}&0\\0&0&1\\\end{pmatrix}}}$
${\displaystyle \det {\frac {\partial (\rho ,\theta ,\phi )}{\partial (r,h,\phi )}}={\frac {1}{\sqrt {r^{2}+h^{2}}}}}$

### To Cylindrical Coordinates

#### From Cartesian Coordinates

${\displaystyle r={\sqrt {x^{2}+y^{2}}}}$
${\displaystyle \theta ={\begin{cases}0&{\mbox{if }}x=0{\mbox{ and }}y=0\\\arcsin({\frac {y}{r}})&{\mbox{if }}x\geq 0\\-\arcsin({\frac {y}{r}})+\pi &{\mbox{if }}x<0\\\end{cases}}}$
${\displaystyle h=z\quad }$

Note that many computer systems may offer a more concise function for computing ${\displaystyle \theta }$, such as atan2(y,x) in the C language.

${\displaystyle {\frac {\partial (r,\theta ,h)}{\partial (x,y,z)}}={\begin{pmatrix}{\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{pmatrix}}}$

#### From Spherical Coordinates(Lana Rule)

${\displaystyle r=\rho \sin \phi \,}$
${\displaystyle h=\rho \cos \phi \,}$
${\displaystyle \theta =\theta \,}$
${\displaystyle {\frac {\partial (r,h,\theta )}{\partial (\rho ,\phi ,\theta )}}={\begin{pmatrix}\sin \phi &\rho \cos \phi &0\\\cos \phi &-\rho \sin \phi &0\\0&0&1\\\end{pmatrix}}}$
${\displaystyle \det {\frac {\partial (r,h,\theta )}{\partial (\rho ,\phi ,\theta )}}=-\rho }$

### Arc length, curvature and torsion from cartesian coordinates

${\displaystyle s=\int _{0}^{t}{\sqrt {x'^{2}+y'^{2}+z'^{2}}}\,dt}$
${\displaystyle \kappa ={\frac {\sqrt {(z''y'-y''z')^{2}+(x''z'-z''x')^{2}+(y''x'-x''y')^{2}}}{(x'^{2}+y'^{2}+z'^{2})^{3/2}}}}$
${\displaystyle \tau ={\frac {z'''(x'y''-y'x'')+z''(x'''y'-x'y''')+z'(x''y'''-x'''y'')}{(x'^{2}+y'^{2}+z'^{2})(x''^{2}+y''^{2}+z''^{2})}}}$