# Accelerator Physics/Coordinate Systems
## Cartesian coordinates

$\mathrm {d} V=\mathrm {d} x\mathrm {d} y\mathrm {d} z$
${\vec {\nabla }}\psi =\left({\frac {\partial \psi }{\partial x}},{\frac {\partial \psi }{\partial y}},{\frac {\partial \psi }{\partial z}}\right)$
${\vec {\nabla }}\cdot {\vec {v}}={\frac {\partial v_{x}}{\partial x}}+{\frac {\partial v_{y}}{\partial y}}+{\frac {\partial v_{z}}{\partial z}}$, sometimes denoted as ${\nabla }\mathrm {v}$
${\vec {\nabla }}\cdot {\vec {v}}=\left({\frac {\partial v_{z}}{\partial y}}-{\frac {\partial v_{y}}{\partial z}},{\frac {\partial v_{x}}{\partial z}}-{\frac {\partial v_{z}}{\partial x}},{\frac {\partial v_{y}}{\partial x}}-{\frac {\partial v_{x}}{\partial y}}\right)$
$\Delta \psi ={\frac {\partial ^{2}\psi _{x}}{\partial x^{2}}}+{\frac {\partial ^{2}\psi _{y}}{\partial y^{2}}}+{\frac {\partial ^{2}\psi _{z}}{\partial z^{2}}}$

## Transformation to other coordinates

The general transformation relations to a new coordinate system $(u_{1},u_{2},u_{3})$ are,
$\mathrm {d} V={\frac {\mathrm {d} u_{1}}{U_{1}}}{\frac {\mathrm {d} u_{2}}{U_{2}}}{\frac {\mathrm {d} u_{3}}{U_{3}}}$
${\vec {\nabla }}\psi =\left(U_{1}{\frac {\partial \psi }{\partial u_{1}}},U_{2}{\frac {\partial \psi }{\partial u_{2}}},U_{3}{\frac {\partial \psi }{\partial u_{3}}}\right)$
${\vec {\nabla }}\cdot {\vec {v}}=U_{1}U_{2}U_{3}\left({\frac {\partial }{\partial u_{1}}}{\frac {v_{u_{1}}}{U_{2}U_{3}}}+{\frac {\partial }{\partial u_{2}}}{\frac {v_{u_{2}}}{U_{1}U_{3}}}+{\frac {\partial }{\partial u_{3}}}{\frac {v_{u_{3}}}{U_{1}U_{2}}}\right)$${\vec {\nabla }}\times {\vec {v}}=\left(U_{2}U_{3}({\frac {\partial }{\partial u_{2}}}{\frac {v_{u_{3}}}{U_{3}}}-{\frac {\partial }{\partial u_{3}}}{\frac {v_{u_{2}}}{U_{2}}}),U_{1}U_{3}({\frac {\partial }{\partial u_{3}}}{\frac {v_{u_{1}}}{U_{1}}}-{\frac {\partial }{\partial u_{1}}}{\frac {v_{u_{3}}}{U_{3}}}),U_{1}U_{2}({\frac {\partial }{\partial u_{1}}}{\frac {v_{u_{2}}}{U_{2}}}-{\frac {\partial }{\partial u_{2}}}{\frac {v_{u_{1}}}{U_{1}}})\right)$$\Delta \psi =U_{1}U_{2}U_{3}\left[{\frac {\partial }{\partial u_{1}}}({\frac {U_{1}}{U_{2}U_{3}}}{\frac {\partial \psi }{\partial u_{1}}})+{\frac {\partial }{\partial u_{2}}}({\frac {U_{2}}{U_{1}U_{3}}}{\frac {\partial \psi }{\partial u_{2}}})+{\frac {\partial }{\partial u_{3}}}({\frac {U_{3}}{U_{1}U_{2}}}{\frac {\partial \psi }{\partial u_{3}}})\right]$,
where
$U_{1}^{-1}={\sqrt {\left({\frac {\partial x}{\partial u_{1}}}\right)^{2}+\left({\frac {\partial y}{\partial u_{1}}}\right)^{2}+\left({\frac {\partial z}{\partial u_{1}}}\right)^{2}}},$
$U_{2}^{-1}={\sqrt {\left({\frac {\partial x}{\partial u_{2}}}\right)^{2}+\left({\frac {\partial y}{\partial u_{2}}}\right)^{2}+\left({\frac {\partial z}{\partial u_{2}}}\right)^{2}}},$
$U_{3}^{-1}={\sqrt {\left({\frac {\partial x}{\partial u_{3}}}\right)^{2}+\left({\frac {\partial y}{\partial u_{3}}}\right)^{2}+\left({\frac {\partial z}{\partial u_{3}}}\right)^{2}}},$
$v_{u_{1}}=v_{x}U_{1}{\frac {\partial x}{\partial u_{1}}}+v_{y}U_{1}{\frac {\partial y}{\partial u_{1}}}+v_{z}U_{1}{\frac {\partial z}{\partial u_{1}}}$
$v_{u_{2}}=v_{x}U_{2}{\frac {\partial x}{\partial u_{2}}}+v_{y}U_{2}{\frac {\partial y}{\partial u_{2}}}+v_{z}U_{2}{\frac {\partial z}{\partial u_{2}}}$
$v_{u_{3}}=v_{x}U_{3}{\frac {\partial x}{\partial u_{3}}}+v_{y}U_{3}{\frac {\partial y}{\partial u_{3}}}+v_{z}U_{3}{\frac {\partial z}{\partial u_{3}}}$

## Cylindrical Coordinates

The cylindrical coordinates $(u_{1}=r,u_{2}=\varphi ,u_{3}=z)$ are related to the cartesian coordinates by
$(x,y,z)=(r\cos \varphi ,r\sin \varphi ,z)$
$\mathrm {d} V=r\ \mathrm {d} r\mathrm {d} \varphi \mathrm {d} z$
${\vec {\nabla }}\psi =\left({\frac {\partial \psi }{\partial r}},{\frac {1}{r}}{\frac {\partial \psi }{\partial \varphi }},{\frac {\partial \psi }{\partial z}}\right)$
${\vec {\nabla }}\cdot {\vec {v}}={\frac {1}{r}}{\frac {\partial }{\partial r}}(rv_{r})+{\frac {1}{r}}{\frac {\partial v_{\varphi }}{\partial \varphi }}+{\frac {\partial v_{z}}{\partial z}}$
${\vec {\nabla }}\times {\vec {v}}=\left({\frac {1}{r}}{\frac {\partial v_{z}}{\partial \varphi }}-{\frac {\partial v_{\phi }}{v_{z}}},{\frac {\partial v_{r}}{\partial z}}-{\frac {\partial v_{z}}{\partial r}},{\frac {1}{r}}{\frac {\partial }{\partial r}}(rv_{\phi })-{\frac {1}{r}}{\frac {\partial v_{r}}{\partial \phi }}\right)$
$\Delta \psi ={\frac {\partial ^{2}\psi }{\partial r^{2}}}+{\frac {1}{r}}{\frac {\partial \psi }{\partial r}}+{\frac {1}{r^{2}}}{\frac {\partial ^{2}\psi }{\partial \varphi ^{2}}}+{\frac {\partial ^{2}\psi }{\partial z^{2}}}$

## Spherical Polar Coordinates

The spherical polar coordinates $(u_{1}=r,u_{2}=\theta ,u_{3}=\varphi )$, or simply the spherical coordinates, are particularly useful when the system in $\mathrm {R} ^{3}$ has a spherical symmetry, such as the motion of a particle under the influence of central forces.
$(x,y,z)=(r\sin \theta \cos \varphi ,r\sin \theta \sin \varphi ,r\cos \theta )$
$U_{1}^{-1}=1,\ U_{2}^{-1}=r,\ U_{3}^{-1}=r\sin \theta$
$\mathrm {d} V=r^{2}\sin \theta \ \mathrm {d} r\mathrm {d} \varphi \mathrm {d} \theta$
${\vec {\nabla }}\psi =\left({\frac {\partial \psi }{\partial r}},{\frac {1}{r}}{\frac {\partial \psi }{\partial \theta }},{\frac {1}{r\sin \theta }}{\frac {\partial \psi }{\partial \varphi }}\right)$
${\vec {\nabla }}\cdot {\vec {v}}={\frac {1}{r^{2}}}{\frac {\partial }{\partial r}}(r^{2}v_{r})+{\frac {1}{r\sin \theta }}{\frac {\partial }{\partial \theta }}(v_{\theta }\sin \theta )+{\frac {1}{r\sin \theta }}{\frac {\partial v_{\varphi }}{\partial \varphi }}$
${\vec {\nabla }}\times {\vec {v}}=\left({\frac {1}{r\sin \theta }}\left({\frac {\partial }{\partial \theta }}(\sin \theta v_{\varphi })-{\frac {\partial v_{\theta }}{\partial \varphi }}\right),{\frac {1}{r\sin \theta }}\left({\frac {\partial v_{r}}{\partial \varphi }}-\sin \theta {\frac {\partial }{\partial r}}(rv_{\varphi })\right),{\frac {1}{r}}\left({\frac {\partial }{\partial r}}(rv_{\theta })-{\frac {\partial v_{r}}{\partial \theta }}\right)\right)$
$\Delta \psi ={\frac {1}{r^{2}}}{\frac {\partial }{\partial r}}\left(r^{2}{\frac {\partial \psi }{\partial r}}\right)+{\frac {1}{r^{2}\sin \theta }}{\frac {\partial }{\partial \theta }}\left(\sin \theta {\frac {\partial \psi }{\partial \theta }}\right)+{\frac {1}{r^{2}\sin ^{2}\theta }}{\frac {\partial ^{2}\psi }{\partial \varphi ^{2}}}$