I Transforming coordinates between Cartesian and spherical

Click For Summary
The discussion revolves around the transformation of coordinates between Cartesian and spherical systems, focusing on the confusion surrounding the use of a specific transformation matrix. The user highlights that while the transformation equations for Cartesian to spherical coordinates are nonlinear and cannot be represented by a matrix, the unit vectors can be transformed using a rotation matrix. They express confusion over an equation presented in various resources that allegedly converts Cartesian vector components to spherical components, which yields nonsensical results when tested with simple values. The user questions the validity of this equation and whether a correct matrix exists for transforming finite displacements between the two coordinate systems. The thread remains open for further clarification and responses.
trekie
Messages
17
Reaction score
0
I apologize if this has been asked before. I searched on this site and others but didn't find this particular issue. My background is physics and math.

My question is near the end of the post. First, let me explain my thoughts leading up to my question. After many years, I'm reviewing the coordinate transformation between cartesian and spherical coordinates. I'm using the physics convention of theta = polar angle, phi = azimuthal angle. The first thing I noticed is that, since the coordinate transformation equations:

$$\mbox{x=r}\sin{\theta}\cos{\phi}$$
$$\mbox{y=r}\sin{\theta}\sin{\phi}$$
$$\mbox{z=r}\cos{\theta}$$

are nonlinear, then they can't be written as a matrix:

$$\left(\begin{array}{cc}x\\y\\z\end{array}\right)\mbox{=}\left(\begin{array}{cc}a_{11}&a_{12}&a_{13}\\a_{21}&a_{22}&a_{23}\\a_{31}&a_{32}&a_{33}\end{array}\right)\left(\begin{array}{cc}r\\\theta\\\phi\end{array}\right)$$

But the unit vectors, being elements of a vector space (which is inherently linear), can be transformed by a matrix:

$$\left(\begin{array}{cc}\hat{r}\\\hat{\theta}\\\hat{\phi}\end{array}\right)\mbox{=}\left(\begin{array}{cc}\sin{\theta}\cos{\phi}&\sin{\theta}\sin{\phi}&\cos{\theta}\\\cos{\theta}\cos{\phi}&\cos{\theta}\sin{\phi}&\mbox{-}\sin{\theta}\\\mbox{-}\sin{\phi}&\cos{\theta}&0\end{array}\right)\left(\begin{array}{cc}\hat{x}\\\hat{y}\\\hat{z}\end{array}\right)$$

Let's call this matrix R since it contains direction cosines and is clearly a rotation matrix (and therefore it's transpose = it's inverse).

Now comes the part that has me confused. Several websites and textbooks include the following equation:

$$\mbox{(equation 1) }\left(\begin{array}{cc}A_{r}\\A_{\theta}\\A_{\phi}\end{array}\right)\mbox{=}\left(\begin{array}{cc}\sin{\theta}\cos{\phi}&\sin{\theta}\sin{\phi}&\cos{\theta}\\\cos{\theta}\cos{\phi}&\cos{\theta}\sin{\phi}&\mbox{-}\sin{\theta}\\\mbox{-}\sin{\phi}&\cos{\theta}&0\end{array}\right)\left(\begin{array}{cc}A_{x}\\A_{y}\\A_{z}\end{array}\right)$$

which seems to be using the matrix R to convert the components of a cartesian vector into the components of a spherical-coordinates vector. This seems to make sense so I tested it on the simplest vector I could think of: a finite displacement from the origin to the point (x,y,z):

$$\Delta \vec{x}\mbox{=}\left(\begin{array}{cc}A_{x}\\A_{y}\\A_{z}\end{array}\right)\mbox{=}\left(\begin{array}{cc}\Delta x\\\Delta y\\\Delta z\end{array}\right)\mbox{=}\left(\begin{array}{cc}x-0\\y-0\\z-0\end{array}\right)\mbox{=}\left(\begin{array}{cc}x\\y\\z\end{array}\right)$$

Therefore plugging ##\Delta \vec{x}## into equation 1:

$$\left(\begin{array}{cc}\Delta \vec{x}_{r}\\\Delta \vec{x}_{\theta}\\\Delta \vec{x}_{\phi}\end{array}\right)\mbox{=}\left(\begin{array}{cc}\sin{\theta}\cos{\phi}&\sin{\theta}\sin{\phi}&\cos{\theta}\\\cos{\theta}\cos{\phi}&\cos{\theta}\sin{\phi}&\mbox{-}\sin{\theta}\\\mbox{-}\sin{\phi}&\cos{\theta}&0\end{array}\right)\left(\begin{array}{cc}x\\y\\z\end{array}\right)$$

where ##\Delta \vec{x}_{r}, \Delta \vec{x}_{\theta}\mbox{, and }\Delta \vec{x}_{\phi}## are the spherical coordinates of the finite displacement from the origin. But plugging in numbers gives gibberish: let (x,y,z) = (1,1,1). Then all sines and cosines of theta and phi are ##1/\sqrt{2}## and

$$\left(\begin{array}{cc}\Delta \vec{x}_{r}\\\Delta \vec{x}_{\theta}\\\Delta \vec{x}_{\phi}\end{array}\right)\mbox{=}\left(\begin{array}{cc}1/2&1/2&1/\sqrt{2}\\1/2&1/2&-1/\sqrt{2}\\-1/\sqrt{2}&1/\sqrt{2}&0\end{array}\right)\left(\begin{array}{cc}1\\1\\1\end{array}\right)$$

giving

$$\left(\begin{array}{cc}\Delta \vec{x}_{r}\\\Delta \vec{x}_{\theta}\\\Delta \vec{x}_{\phi}\end{array}\right)\mbox{=}\left(\begin{array}{cc}1+\frac{1}{\sqrt{2}}\\1-\frac{1}{\sqrt{2}}\\0\end{array}\right)$$

which makes no sense to me. The radial component of the displacement should = the magnitude of the displacement = ##\sqrt{3}##, and how can the phi component = zero?

1. Is equation 1 true?
2. If eqn. 1 is wrong then is there a matrix that transforms the components of a finite displacement between cartesian and spherical coordinates?
3. If eqn. 1 is true, then did I use equation 1 correctly?
 
Mathematics news on Phys.org
Thread closed temporarily for Moderation.

@trekie -- Please respond to the PM that I sent you over 12 hours ago. Thank you.
 
Seemingly by some mathematical coincidence, a hexagon of sides 2,2,7,7, 11, and 11 can be inscribed in a circle of radius 7. The other day I saw a math problem on line, which they said came from a Polish Olympiad, where you compute the length x of the 3rd side which is the same as the radius, so that the sides of length 2,x, and 11 are inscribed on the arc of a semi-circle. The law of cosines applied twice gives the answer for x of exactly 7, but the arithmetic is so complex that the...
Back
Top