- #1
trekie
- 17
- 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?
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?