PlanetPhysics/Transformation Between Cartesian Basis Vectors and Polar Basis Vectors

From the definition of a covariant vector (covariant tensor of rank 1)

$$ \bar{T}_{i} = T_{j}\frac{\partial x^{j}}{\partial \bar{x}^{i}} $$

the corresponding transformation matrix is

$$ A_{ij} = \frac{\partial x^{j}}{\partial \bar{x}^{i}} $$

In order to calculate the transformation matrix, we need the equations relating the two coordinates systems. For cartesian to polar, we have

$$ r = \sqrt{ x^2 + y^2 } $$ $$ \theta = tan^{-1}\left( \frac{y}{x} \right) $$

and for polar to cartesian

$$ x = r \cos \theta $$ $$ y = r \sin \theta $$

So if we designate $$(\hat{e}_x,\hat{e}_y)$$ as the bar coordinates, then the transformation components from a polar basis vector $$(\hat{e}_r,\hat{e}_{\theta})$$ to a cartesian basis vector $$(\hat{e}_x,\hat{e}_y)$$ is calculted as

$$ A_{11} = \frac{\partial {x}^{1}}{\partial \bar{x}^{1}} = \frac{\partial r}{\partial x} = \frac{x}{\sqrt{x^2 + y^2}}$$

$$ A_{12} = \frac{\partial {x}^{2}}{\partial \bar{x}^{1}} = \frac{\partial \theta}{\partial x} = -\frac{y}{x^2 + y^2}$$

$$ A_{21} = \frac{\partial {x}^{1}}{\partial \bar{x}^{2}} = \frac{\partial r}{\partial y} = \frac{y}{\sqrt{x^2 + y^2}}$$

$$ A_{22} = \frac{\partial {x}^{2}}{\partial \bar{x}^{2}} = \frac{\partial \theta}{\partial y} = \frac{x}{x^2 + y^2}$$

The components of cartesian basis vectors to polar basis vectors transform the same way, but now the polar coordinates have the bar

$$ B_{11} = \frac{\partial {x}^{1}}{\partial \bar{x}^{1}} = \frac{\partial x}{\partial r} = \cos \theta$$

$$ B_{12} = \frac{\partial {x}^{2}}{\partial \bar{x}^{1}} = \frac{\partial y}{\partial r} = \sin \theta$$

$$ B_{21} = \frac{\partial {x}^{1}}{\partial \bar{x}^{2}} = \frac{\partial x}{\partial \theta} = -r \sin \theta$$

$$ B_{22} = \frac{\partial {x}^{2}}{\partial \bar{x}^{2}} = \frac{\partial y}{\partial \theta} = r \cos \theta$$

In summary, the {\mathbf components of covariant basis vectors} in cartesian coordinates and polar coordinates transform between each other according to

$$ \left[ \begin{matrix} \hat{e}_x \\ \hat{e}_y \end{matrix} \right] = \left[ \begin{matrix} \frac{x}{\sqrt{x^2 + y^2}} & -\frac{y}{x^2 + y^2} \\ \frac{y}{\sqrt{x^2 + y^2}} & \frac{x}{x^2 + y^2} \end{matrix} \right] \left[ \begin{matrix} \hat{e}_r \\ \hat{e}_{\theta} \end{matrix} \right] $$

$$ \left[ \begin{matrix} \hat{e}_r \\ \hat{e}_{\theta} \end{matrix} \right]=\left[ \begin{matrix} \cos \theta & \sin \theta \\ -r \sin \theta & r \cos \theta \end{matrix} \right] \left[ \begin{matrix} \hat{e}_x \\ \hat{e}_y \end{matrix} \right]$$