# Converting Cartesian to Cylindrical/Spherical Unit Vectors

• queenstudy
In summary: Apparently you already know: in polar coordinates, the vector from the origin to a point on the unit circle at angle φ is represented by the vector \boldsymbol{\hat \rho}. The vector \boldsymbol{\hat\rho} can be seen as the result of a rotation of \mathbf{\hat x} over an angle of φ. Similarly, the vector \mathbf{\hat y} is the result of a rotation of \boldsymbol{\hat \phi} over an angle of φ-θ. To get the inverse of this, we use the rotation matrix R: R = \begin{pmatrix}\cos φ & -\sin φ \\ \

#### queenstudy

can i get some help in how i can convert from cartesian to cylindrical and spherical unit vectors and vice versa ? thank you

queenstudy said:

Hmm, well, you can basically read them directly off the drawing of the coordinates.

Is there anyone in particular for which you would like an explanation?

yes
in the definition of unit vectors how did we get the cartesian coordinates in terms of cylinderical coordinates

queenstudy said:
yes
in the definition of unit vectors how did we get the cartesian coordinates in terms of cylinderical coordinates

Do you mean:
$$\begin{matrix} \mathbf{\hat x} & = & \cos\phi\boldsymbol{\hat \rho}-\sin\phi\boldsymbol{\hat\phi} \\ \mathbf{\hat y} & = & \sin\phi\boldsymbol{\hat \rho}+\cos\phi\boldsymbol{\hat\phi} \\ \mathbf{\hat z} & = & \mathbf{\hat z} \end{matrix}$$
?

yes please because we know how the opposite happens

queenstudy said:
yes please because we know how the opposite happens

The only interesting ones are $\mathbf{\hat x}$ and $\mathbf{\hat y}$.
So we're actually talking about 2-dimensional polar coordinates.

Here's one way to derive the unit vectors.

$\boldsymbol{\hat \rho}$ corresponds in this case with the vector from the origin to a point on the unit circle at angle $\phi$.

The vector $\boldsymbol{\hat \rho}$ can be seen as the result of a rotation of $\mathbf{\hat x}$ over an angle of $\phi$.

Or in reverse, the vector $\mathbf{\hat x}$ is the result of a rotation of $\boldsymbol{\hat \rho}$ over an angle of $-\phi$.
Similarly the vector $\mathbf{\hat y}$ is the result of a rotation of $\boldsymbol{\hat \phi}$ over an angle of $-\phi$.

We need the rotation matrix for an angle $\phi$ is to get what we want:
$$R = \begin{pmatrix}\cos \phi & -\sin \phi \\ \sin \phi & \cos \phi \end{pmatrix}$$

Multiply $R$ with $\boldsymbol{\hat \rho}$ and $\boldsymbol{\hat \phi}$ and the result rolls out:
$$\begin{matrix} \mathbf{\hat x} & = & \cos\phi\boldsymbol{\hat \rho}-\sin\phi\boldsymbol{\hat\phi} \\ \mathbf{\hat y} & = & \sin\phi\boldsymbol{\hat \rho}+\cos\phi\boldsymbol{\hat\phi} \end{matrix}$$

i know how raw and phy are in terms of x hat and y hat how did you change that to the last line I am still not getting the idea??

queenstudy said:
i know how raw and phy are in terms of x hat and y hat how did you change that to the last line I am still not getting the idea??

$$\begin{matrix} \boldsymbol{\hat \rho} & = & \cos\phi\mathbf{\hat x}+\sin\phi \mathbf{\hat y}\\ \boldsymbol{\hat\phi} & = & -\sin\phi\mathbf{\hat x}+\cos\phi \mathbf{\hat y} \end{matrix}$$
$$\begin{pmatrix} \boldsymbol{\hat \rho} \\ \boldsymbol{\hat\phi} \end{pmatrix} = \begin{pmatrix} \cos \phi & \sin \phi \\ -\sin \phi & \cos \phi \end{pmatrix} \begin{pmatrix} \mathbf{\hat x} \\ \mathbf{\hat y} \end{pmatrix}$$
$$\begin{pmatrix} \mathbf{\hat x} \\ \mathbf{\hat y} \end{pmatrix} = \begin{pmatrix} \cos \phi & -\sin \phi \\ \sin \phi & \cos \phi \end{pmatrix} \begin{pmatrix} \boldsymbol{\hat \rho} \\ \boldsymbol{\hat\phi} \end{pmatrix}$$