how to change polar coordinate into cartesian coordinate using transformation matrix

16.2k Views Asked by At

I would like to change $(3,4,12)$ in $xyz$ coordinate to spherical coordinate using the following relation
enter image description here
It is from the this link. I do not understand the significance of this matrix (if not for coordinate transformation) or how it is derived. Also please check my previous question building transformation matrix from spherical to cartesian coordinate system. Please I need your insight on building my concept.

Thank you.
EDIT::
I understand that $ \left [ A_x \sin \theta\cos \phi \hspace{5 mm} A_y \sin \theta\sin\phi \hspace{5 mm} A_z\cos\theta\right ]$ gives $A_r$ but how is other coordinates $ (A_\theta, A_\phi)$ equal to their respective respective rows from Matrix multiplication?

2

There are 2 best solutions below

8
On BEST ANSWER

The transformation from Cartesian to polar coordinates is not a linear function, so it cannot be achieved by means of a matrix multiplication.

1
On

The first answer is wrong, you can get a transformation matrix between cartesian coordinates and polar coordinates .

What you need to do to derive the transformation matrix is first wrtie out all the relation between both coordinations.

For example, the relation between cartesian coordinates and polar coordinates are: $$x=r\cos \theta \hspace{1cm} y=r\sin \theta $$ $$r=\sqrt{x^2+y^2} \hspace{1cm} \theta = \tan^{-1} \frac{y}{x}$$ From chain rule of partial differiation, we have $$dx=\frac{\partial x}{\partial r}dr+\frac{\partial x}{\partial \theta}d\theta$$ $$dy=\frac{\partial y}{\partial r}dr+\frac{\partial y}{\partial \theta}d\theta$$ Therefore, in matrix notation we have $$ \begin{bmatrix} dx\\dy \end{bmatrix} = \begin{bmatrix} \frac{\partial x}{\partial r} & \frac{\partial x}{\partial \theta}\\ \frac{\partial y}{\partial r} & \frac{\partial y}{\partial \theta} \end{bmatrix} \begin{bmatrix} dr\\d\theta \end{bmatrix} $$ By definition, an arbitary vector A must transform the same way as the componenets of the displacement do. So we have: $$ \begin{bmatrix} A_x\\A_y \end{bmatrix} = \begin{bmatrix} \frac{\partial x}{\partial r} & \frac{\partial x}{\partial \theta}\\ \frac{\partial y}{\partial r} & \frac{\partial y}{\partial \theta} \end{bmatrix} \begin{bmatrix} A_r\\A_{\theta} \end{bmatrix} $$ Calculate the partial differiation yourself and subsitude them into the matrix. Do an inverse on the transfomation matrix and you shall get the inverse transformation relation. For your information I shall give the end result:

$$ \begin{bmatrix}A_x\\A_y\end{bmatrix} = \begin{bmatrix}\cos \theta &-r\sin \theta \\\sin \theta &r\cos \theta \end{bmatrix} \begin{bmatrix}A_r\\A_{\theta} \end{bmatrix} $$

$$ \begin{bmatrix}A_r\\A_{\theta} \end{bmatrix} = \begin{bmatrix}{\frac {x}{\sqrt {x^{2}+y^{2}}}}&{\frac {y}{\sqrt {x^{2}+y^{2}}}}\\-{\frac {y}{x^{2}+y^{2}}}&{\frac {x}{x^{2}+y^{2}}}\end{bmatrix} \begin{bmatrix}A_x\\A_y\end{bmatrix} $$

Similarly for the transformation between cartesian coordinates and spherical coordinates. Do the same thing as I did for cartesian coordinates and polar coordinates. Write out their relation explicitly, do partial differtiation, contruction the forward transformation matrix, and do the inverse. You shall get the result from your image.