[Math] Cartesian vector at a point to cylindrical and spherical coordinates

coordinate systemsspherical coordinatestransformationvector analysisvectors

So I'm working on a math problem about changing coordinate systems. Were given a Cartesian vector defined as:

$\vec{V} = \hat{e}_x + \hat{e}_y + \hat{e}_z$,

which is defined at point (1, 2, 1). I'm asked to find the components of this vector in the cylindrical and spherical systems.

My first thought was to use $r = x^2+y^2$, $\phi = tan^{-1}(y/x)$, and $z = z$ for the cylindrical part which would give me

$\vec{V} = \sqrt{5}\hat{e}_r + tan^{-1}(2)\hat{e}_\phi + \hat{e}_z$,

But that felt too easy. Am I missing something?

Thanks.

Best Answer

enter image description here

If you spend some time considering the above picture (edit: and I just noticed that you need to switch the positions of $\phi$ and $\theta$ to get the formulas I have below), you'll see that the change of basis from Cartesian to spherical can be written in matrix form as

$$\pmatrix{\hat e_x \\ \hat e_y \\ \hat e_z} = \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}\pmatrix{\hat e_\rho \\ \hat e_\theta \\ \hat e_\phi}$$

Thus $$\vec V = \hat e_x + \hat e_y + \hat e_z \\ = [\sin\theta\cos\phi \hat e_\rho + \cos\theta\cos\phi \hat e_\theta -\sin\phi \hat e_\phi] + [\sin\theta\sin\phi \hat e_\rho + \cos\theta\sin\phi \hat e_\theta + \cos\phi \hat e_\phi] + [\cos\theta \hat e_\rho -\sin\theta \hat e_\theta] \\ = [\sin\theta\cos\phi + \sin\theta\sin\phi + \cos\theta]\hat e_\rho + [\cos\theta\cos\phi + \cos\theta\sin\phi -\sin\theta] \hat e_\theta + [\cos\phi -\sin\phi] \hat e_\phi$$

where $\theta = \arccos\left(\dfrac{z}{\sqrt{x^2+y^2+z^2}}\right) = \arccos\left(\frac 1{\sqrt{6}}\right)$ and $\phi =$ $\operatorname{atan2}(y,x)$ $= \arctan\left(2\right)$.

You can get the cylindrical representation of $\vec V$ similarly. The Wikipedia page on 3D polar vector fields might be a useful resource.