This is a list of some of the most commonly used coordinate transformations .
Let
(
x
,
y
)
{\displaystyle (x,y)}
be the standard Cartesian coordinates , and
(
r
,
th
)
{\displaystyle (r,\theta )}
the standard polar coordinates .
To Cartesian coordinates [ edit ]
From polar coordinates [ edit ]
x
=
r
cos
th
y
=
r
sin
th
(
x
,
y
)
(
r
,
th
)
=
[
cos
th
-
r
sin
th
sin
th
-
r
cos
th
]
Jacobian
=
det
(
x
,
y
)
(
r
,
th
)
=
r
{\displaystyle {\begin{aligned}x&=r\cos \theta \\y&=r\sin \theta \\[5pt]{\frac {\partial (x,y)}{\partial (r,\theta )}}&={\begin{bmatrix}\cos \theta &-r\sin \theta \\\sin \theta &{\phantom {-}}r\cos \theta \end{bmatrix}}\\[5pt]{\text{Jacobian}}=\det {\frac {\partial (x,y)}{\partial (r,\theta )}}&=r\end{aligned}}}
From log-polar coordinates [ edit ]
x
=
e
r
cos
th
,
y
=
e
r
sin
th
.
{\displaystyle {\begin{aligned}x&=e^{\rho }\cos \theta ,\\y&=e^{\rho }\sin \theta .\end{aligned}}}
By using complex numbers
(
x
,
y
)
=
x
+
i
y
'
{\displaystyle (x,y)=x+iy'}
, the transformation can be written as
x
+
i
y
=
e
r
+
i
th
{\displaystyle x+iy=e^{\rho +i\theta }}
That is, it is given by the complex exponential function .
From bipolar coordinates [ edit ]
x
=
a
sinh
t
cosh
t
-
cos
s
y
=
a
sin
s
cosh
t
-
cos
s
{\displaystyle {\begin{aligned}x&=a{\frac {\sinh \tau }{\cosh \tau -\cos \sigma }}\\y&=a{\frac {\sin \sigma }{\cosh \tau -\cos \sigma }}\end{aligned}}}
From 2-center bipolar coordinates [ edit ]
x
=
1
4
c
(
r
1
2
-
r
2
2
)
y
=
+-
1
4
c
16
c
2
r
1
2
-
(
r
1
2
-
r
2
2
+
4
c
2
)
2
{\displaystyle {\begin{aligned}x&={\frac {1}{4c}}\left(r_{1}^{2}-r_{2}^{2}\right)\\[1ex]y&=\pm {\frac {1}{4c}}{\sqrt {16c^{2}r_{1}^{2}-\left(r_{1}^{2}-r_{2}^{2}+4c^{2}\right)^{2}}}\end{aligned}}}
From Cesaro equation[ edit ]
x
=
cos
[
k
(
s
)
d
s
]
d
s
y
=
sin
[
k
(
s
)
d
s
]
d
s
{\displaystyle {\begin{aligned}x&=\int \cos \left[\int \kappa (s)\,ds\right]ds\\y&=\int \sin \left[\int \kappa (s)\,ds\right]ds\end{aligned}}}
To polar coordinates [ edit ]
From Cartesian coordinates [ edit ]
r
=
x
2
+
y
2
th
'
=
arctan
|
y
x
|
{\displaystyle {\begin{aligned}r&={\sqrt {x^{2}+y^{2}}}\\\theta '&=\arctan \left|{\frac {y}{x}}\right|\end{aligned}}}
Note: solving for
th
'
{\displaystyle \theta '}
returns the resultant angle in the first quadrant (
0
<
th
<
p
2
{\textstyle 0<\theta <{\frac {\pi }{2}}}
). To find
th
,
{\displaystyle \theta ,}
one must refer to the original Cartesian coordinate, determine the quadrant in which
th
{\displaystyle \theta }
lies (for example, (3,-3) [Cartesian] lies in QIV), then use the following to solve for
th
:
{\displaystyle \theta :}
th
=
{
th
'
for
th
'
in QI:
0
<
th
'
<
p
2
p
-
th
'
for
th
'
in QII:
p
2
<
th
'
<
p
p
+
th
'
for
th
'
in QIII:
p
<
th
'
<
3
p
2
2
p
-
th
'
for
th
'
in QIV:
3
p
2
<
th
'
<
2
p
{\displaystyle \theta ={\begin{cases}\theta '&{\text{for }}\theta '{\text{ in QI: }}&0<\theta '<{\frac {\pi }{2}}\\[1.2ex]\pi -\theta '&{\text{for }}\theta '{\text{ in QII: }}&{\frac {\pi }{2}}<\theta '<\pi \\[1.2ex]\pi +\theta '&{\text{for }}\theta '{\text{ in QIII: }}&\pi <\theta '<{\frac {3\pi }{2}}\\[1.2ex]2\pi -\theta '&{\text{for }}\theta '{\text{ in QIV: }}&{\frac {3\pi }{2}}<\theta '<2\pi \end{cases}}}
The value for
th
{\displaystyle \theta }
must be solved for in this manner because for all values of
th
{\displaystyle \theta }
,
tan
th
{\displaystyle \tan \theta }
is only defined for
-
p
2
<
th
<
+
p
2
{\textstyle -{\frac {\pi }{2}}<\theta <+{\frac {\pi }{2}}}
, and is periodic (with period
p
{\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
r
=
x
2
+
y
2
th
'
=
2
arctan
y
x
+
r
{\displaystyle {\begin{aligned}r&={\sqrt {x^{2}+y^{2}}}\\\theta '&=2\arctan {\frac {y}{x+r}}\end{aligned}}}
From 2-center bipolar coordinates [ edit ]
r
=
r
1
2
+
r
2
2
-
2
c
2
2
th
=
arctan
[
8
c
2
(
r
1
2
+
r
2
2
-
2
c
2
)
r
1
2
-
r
2
2
-
1
]
{\displaystyle {\begin{aligned}r&={\sqrt {\frac {r_{1}^{2}+r_{2}^{2}-2c^{2}}{2}}}\\\theta &=\arctan \left[{\sqrt {{\frac {8c^{2}(r_{1}^{2}+r_{2}^{2}-2c^{2})}{r_{1}^{2}-r_{2}^{2}}}-1}}\right]\end{aligned}}}
Where 2c is the distance between the poles.
To log-polar coordinates from Cartesian coordinates [ edit ]
r
=
log
x
2
+
y
2
,
th
=
arctan
y
x
.
{\displaystyle {\begin{aligned}\rho &=\log {\sqrt {x^{2}+y^{2}}},\\\theta &=\arctan {\frac {y}{x}}.\end{aligned}}}
Arc-length and curvature [ edit ]
In Cartesian coordinates [ edit ]
k
=
x
'
y
''
-
y
'
x
''
(
x
'
2
+
y
'
2
)
3
2
s
=
a
t
x
'
2
+
y
'
2
d
t
{\displaystyle {\begin{aligned}\kappa &={\frac {x'y''-y'x''}{\left({x'}^{2}+{y'}^{2}\right)^{\frac {3}{2}}}}\\s&=\int _{a}^{t}{\sqrt {{x'}^{2}+{y'}^{2}}}\,dt\end{aligned}}}
In polar coordinates [ edit ]
k
=
r
2
+
2
r
'
2
-
r
r
''
(
r
2
+
r
'
2
)
3
2
s
=
a
ph
r
2
+
r
'
2
d
ph
{\displaystyle {\begin{aligned}\kappa &={\frac {r^{2}+2{r'}^{2}-rr''}{(r^{2}+{r'}^{2})^{\frac {3}{2}}}}\\s&=\int _{a}^{\varphi }{\sqrt {r^{2}+{r'}^{2}}}\,d\varphi \end{aligned}}}
For spherical coordinates, this article uses the convention that
r
{\displaystyle r}
is radial distance,
th
{\displaystyle \theta }
is the zenith angle, and
ph
{\displaystyle \phi }
is the azimuthal angle.
Let (x, y, z) be the standard Cartesian coordinates, and (r, th, ph) the spherical coordinates , with th the angle measured away from the +Z axis (as illustrated). As ph has a range of 360deg the same considerations as in polar (2 dimensional) coordinates apply whenever an arctangent of it is taken. th has a range of 180deg, running from 0deg to 180deg, and does not pose any problem when calculated from an arccosine, but beware for an arctangent.
If, in the alternative definition, th is chosen to run from -90deg to +90deg, 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 th 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 [ edit ]
From spherical coordinates [ edit ]
x
=
r
sin
th
cos
ph
y
=
r
sin
th
sin
ph
z
=
r
cos
th
(
x
,
y
,
z
)
(
r
,
th
,
ph
)
=
(
sin
th
cos
ph
r
cos
th
cos
ph
-
r
sin
th
sin
ph
sin
th
sin
ph
r
cos
th
sin
ph
r
sin
th
cos
ph
cos
th
-
r
sin
th
0
)
{\displaystyle {\begin{aligned}x&=\rho \,\sin \theta \cos \varphi \\y&=\rho \,\sin \theta \sin \varphi \\z&=\rho \,\cos \theta \\{\frac {\partial (x,y,z)}{\partial (\rho ,\theta ,\varphi )}}&={\begin{pmatrix}\sin \theta \cos \varphi &\rho \cos \theta \cos \varphi &-\rho \sin \theta \sin \varphi \\\sin \theta \sin \varphi &\rho \cos \theta \sin \varphi &\rho \sin \theta \cos \varphi \\\cos \theta &-\rho \sin \theta &0\end{pmatrix}}\end{aligned}}}
So for the volume element :
d
x
d
y
d
z
=
det
(
x
,
y
,
z
)
(
r
,
th
,
ph
)
d
r
d
th
d
ph
=
r
2
sin
th
d
r
d
th
d
ph
{\displaystyle dx\,dy\,dz=\det {\frac {\partial (x,y,z)}{\partial (\rho ,\theta ,\varphi )}}\,d\rho \,d\theta \,d\varphi =\rho ^{2}\sin \theta \,d\rho \,d\theta \,d\varphi }
From cylindrical coordinates [ edit ]
x
=
r
cos
th
y
=
r
sin
th
z
=
z
(
x
,
y
,
z
)
(
r
,
th
,
z
)
=
(
cos
th
-
r
sin
th
0
sin
th
r
cos
th
0
0
0
1
)
{\displaystyle {\begin{aligned}x&=r\,\cos \theta \\y&=r\,\sin \theta \\z&=z\,\\{\frac {\partial (x,y,z)}{\partial (r,\theta ,z)}}&={\begin{pmatrix}\cos \theta &-r\sin \theta &0\\\sin \theta &r\cos \theta &0\\0&0&1\end{pmatrix}}\end{aligned}}}
So for the volume element:
d
V
=
d
x
d
y
d
z
=
det
(
x
,
y
,
z
)
(
r
,
th
,
z
)
d
r
d
th
d
z
=
r
d
r
d
th
d
z
{\displaystyle dV=dx\,dy\,dz=\det {\frac {\partial (x,y,z)}{\partial (r,\theta ,z)}}\,dr\,d\theta \,dz=r\,dr\,d\theta \,dz}
To spherical coordinates [ edit ]
From Cartesian coordinates [ edit ]
r
=
x
2
+
y
2
+
z
2
th
=
arctan
(
x
2
+
y
2
z
)
=
arccos
(
z
x
2
+
y
2
+
z
2
)
ph
=
arctan
(
y
x
)
=
arccos
(
x
x
2
+
y
2
)
=
arcsin
(
y
x
2
+
y
2
)
(
r
,
th
,
ph
)
(
x
,
y
,
z
)
=
(
x
r
y
r
z
r
x
z
r
2
x
2
+
y
2
y
z
r
2
x
2
+
y
2
-
x
2
+
y
2
r
2
-
y
x
2
+
y
2
x
x
2
+
y
2
0
)
{\displaystyle {\begin{aligned}\rho &={\sqrt {x^{2}+y^{2}+z^{2}}}\\\theta &=\arctan \left({\frac {\sqrt {x^{2}+y^{2}}}{z}}\right)=\arccos \left({\frac {z}{\sqrt {x^{2}+y^{2}+z^{2}}}}\right)\\\varphi &=\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)\\{\frac {\partial \left(\rho ,\theta ,\varphi \right)}{\partial \left(x,y,z\right)}}&={\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}}\end{aligned}}}
See also the article on atan2 for how to elegantly handle some edge cases.
So for the element:
d
r
d
th
d
ph
=
det
(
r
,
th
,
ph
)
(
x
,
y
,
z
)
d
x
d
y
d
z
=
1
x
2
+
y
2
x
2
+
y
2
+
z
2
d
x
d
y
d
z
{\displaystyle d\rho \,d\theta \,d\varphi =\det {\frac {\partial (\rho ,\theta ,\varphi )}{\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 [ edit ]
r
=
r
2
+
h
2
th
=
arctan
r
h
ph
=
ph
(
r
,
th
,
ph
)
(
r
,
h
,
ph
)
=
(
r
r
2
+
h
2
h
r
2
+
h
2
0
h
r
2
+
h
2
-
r
r
2
+
h
2
0
0
0
1
)
det
(
r
,
th
,
ph
)
(
r
,
h
,
ph
)
=
1
r
2
+
h
2
{\displaystyle {\begin{aligned}\rho &={\sqrt {r^{2}+h^{2}}}\\\theta &=\arctan {\frac {r}{h}}\\\varphi &=\varphi \\{\frac {\partial (\rho ,\theta ,\varphi )}{\partial (r,h,\varphi )}}&={\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}}\\\det {\frac {\partial (\rho ,\theta ,\varphi )}{\partial (r,h,\varphi )}}&={\frac {1}{\sqrt {r^{2}+h^{2}}}}\end{aligned}}}
To cylindrical coordinates [ edit ]
From Cartesian coordinates [ edit ]
r
=
x
2
+
y
2
th
=
arctan
(
y
x
)
z
=
z
{\displaystyle {\begin{aligned}r&={\sqrt {x^{2}+y^{2}}}\\\theta &=\arctan {\left({\frac {y}{x}}\right)}\\z&=z\quad \end{aligned}}}
(
r
,
th
,
h
)
(
x
,
y
,
z
)
=
(
x
x
2
+
y
2
y
x
2
+
y
2
0
-
y
x
2
+
y
2
x
x
2
+
y
2
0
0
0
1
)
{\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 [ edit ]
r
=
r
sin
ph
h
=
r
cos
ph
th
=
th
(
r
,
h
,
th
)
(
r
,
ph
,
th
)
=
(
sin
ph
r
cos
ph
0
cos
ph
-
r
sin
ph
0
0
0
1
)
det
(
r
,
h
,
th
)
(
r
,
ph
,
th
)
=
-
r
{\displaystyle {\begin{aligned}r&=\rho \sin \varphi \\h&=\rho \cos \varphi \\\theta &=\theta \\{\frac {\partial (r,h,\theta )}{\partial (\rho ,\varphi ,\theta )}}&={\begin{pmatrix}\sin \varphi &\rho \cos \varphi &0\\\cos \varphi &-\rho \sin \varphi &0\\0&0&1\\\end{pmatrix}}\\\det {\frac {\partial (r,h,\theta )}{\partial (\rho ,\varphi ,\theta )}}&=-\rho \end{aligned}}}
Arc-length, curvature and torsion from Cartesian coordinates[ edit ]
s
=
0
t
x
'
2
+
y
'
2
+
z
'
2
d
t
k
=
(
z
''
y
'
-
y
''
z
'
)
2
+
(
x
''
z
'
-
z
''
x
'
)
2
+
(
y
''
x
'
-
x
''
y
'
)
2
(
x
'
2
+
y
'
2
+
z
'
2
)
3
2
t
=
x
'''
(
y
'
z
''
-
y
''
z
'
)
+
y
'''
(
x
''
z
'
-
x
'
z
''
)
+
z
'''
(
x
'
y
''
-
x
''
y
'
)
(
x
'
y
''
-
x
''
y
'
)
2
+
(
x
''
z
'
-
x
'
z
''
)
2
+
(
y
'
z
''
-
y
''
z
'
)
2
{\displaystyle {\begin{aligned}s&=\int _{0}^{t}{\sqrt {{x'}^{2}+{y'}^{2}+{z'}^{2}}}\,dt\\[3pt]\kappa &={\frac {\sqrt {\left(z''y'-y''z'\right)^{2}+\left(x''z'-z''x'\right)^{2}+\ left(y''x'-x''y'\right)^{2}}}{\left({x'}^{2}+{y'}^{2}+{z'}^{ 2}\right)^{\frac {3}{2}}}}\\[3pt]\tau &={\frac {x'''\left(y'z''-y''z'\right)+y'''\left(x''z'-x'z''\right)+z'''\left(x'y''-x''y'\right)}{{\left(x'y''-x''y'\right)}^{2}+{\left(x''z'-x'z''\right)}^{2}+{\left(y'z''-y''z'\right)}^{2}}}\end{aligned}}}