### Cylindrical and Spherical Coords Conversion from Cartesian Coords: | | Coordinates | Basis Vector | | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Cylindrical | $r=\sqrt{ x^{2}+y^{2} }lt;br>$\phi=\operatorname{atan2}(y,x)lt;br>${} z=z {}$ | $\hat{r}=\cos \phi~\hat{x}+\sin \phi~\hat{y}lt;br>$\hat{\phi}=-\sin \phi ~\hat{x}+\cos \phi ~\hat{y}lt;br>${} \hat{z}=\hat{z} {}$ | | Spherical | $r=\sqrt{ x^{2}+y^{2}+z^{2} }lt;br>$\theta=\cos ^{-1}\left( \frac{z}{\sqrt{ x^{2}+y^{2}+z^{2} }} \right)lt;br>${} \phi=\operatorname{atan2}(y,x) {}$ | ${} \begin{pmatrix}\hat{r} \\ \hat{\theta} \\ \hat{\phi}\end{pmatrix}=\begin{pmatrix}\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{pmatrix}\begin{pmatrix}\hat{x} \\ \hat{y} \\ \hat{z}\end{pmatrix} {}$ | Conversion to Cartesian coords | | Coordinates | Basis Vectors | | ----------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Cylindrical | $x=r\cos \philt;br>$y=r\sin \philt;br>${} z=z {}$ | $\hat{x}=\cos \phi~\hat{r}-\sin \phi~\hat{\phi}lt;br>$\hat{y}=\sin \phi ~\hat{r}+\cos \phi~\hat{\phi}lt;br>${} \hat{z}=\hat{z} {}$ | | Spherical | $x=r\sin\theta \cos \philt;br>$y=r\sin\theta \sin \philt;br>${} z=r\cos\theta {}$ | $\begin{pmatrix}\hat{x} \\ \hat{y} \\ \hat{z}\end{pmatrix}=\begin{pmatrix}\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{pmatrix}\begin{pmatrix}\hat{r} \\ \hat{\theta} \\ \hat{\phi}\end{pmatrix}$ |