how to change polar coordinate into cartesian coordinate using transformation matrix

$\begingroup$

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?

$\endgroup$ 2

5 Answers

$\begingroup$

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

$\endgroup$ 8 $\begingroup$

This is not the Matrix you're looking for. For a simple co-ordinate switch you can just use the relations:

$$\begin{align*}x &= \rho\sin\theta\cos\phi\\ y &= \rho\sin\theta\sin\phi \\ z &= \rho\cos\theta\end{align*}$$

And the inverse operations:

$$\begin{align*}\rho &= \sqrt{x^2 + y^2 + z^2}\\ \phi &= \arctan\dfrac yx\\ \theta &= \arctan\left(\frac{\sqrt{x^2 + y^2}}z\right)\end{align*}$$

However the matrix you've found is for mapping a vector between the co-ordinate systems. For example (using a textbook, Engineering Electromagnetics by Demarest. Example 2-6, p34)

Need to do an integration of $\int( r^3\cos\phi\sin\theta\cdot Ar) d\theta d\phi$

Where $Ar$ is a unit vector in the radial direction. The integral is over phi and theta but also dependent on phi and theta, therefore it's much easier to do this by switching back to cartesian coordinates by the relation:

$$Ar = \sin\theta\cos\phi\cdot Ax + \sin\theta\sin\phi\cdot Ay + \cos\theta\cdot Az$$

Once we substitute that straight in for Ar the integral looks longer but we've removed the dependence inside the integrand, so we can do the integration in a straight forward way.

$\endgroup$ $\begingroup$

I have checked the formula on the link to transform from cartesian to spherical co-ords and it is correct. While it is correct that this is a nonlinear transformation for a vector field, the formula represent the correct linear transformation of a vector at any particular point in that field. Hope that helps since you helped me to fine that link.

$\endgroup$ $\begingroup$

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.

$\endgroup$ 1 $\begingroup$

This is actually the matrix used for Rotation. if u have a coordinate of point X, this matrix gives the rotational matrix to find point Y, given theta.

$\endgroup$ 1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like