Coordinate transformation from spherical to rectangular

In summary, when fixing two coordinates and letting the last one vary, we can define a space curve that represents the path of the vector as it changes. The unit vector in a particular direction is equal to the derivative of the vector in that direction divided by the magnitude of that derivative, which allows us to understand the direction and magnitude of the vector as it moves along the curve.
  • #1
TheArun
25
0
Iam having trouble understanding how one arrives at the transformation matrix for spherical to rectangular coordinates.
I understand till getting the (x,y,z) from (r,th
ie.,
z = rcos@
y = rsin@sin#
x = rsin@cos#

Note:
@ - theta (vertical angle)
# - phi (horizontal angle)

Please show me how to get the transformation matrix. Thanks in advance!
 
Mathematics news on Phys.org
  • #2
First use the definitions of unit vectors
$$
\hat e_r = \frac{\frac{\partial \vec r}{\partial r}}{ \left | \frac{\partial \vec r}{\partial r} \right |}, \hat e_\theta = \frac{\frac{\partial \vec r}{\partial \theta}}{ \left | \frac{\partial \vec r}{\partial \theta} \right |}, \;\; \hat e_\phi = \frac{\frac{\partial \vec r}{\partial \phi}}{ \left | \frac{\partial \vec r}{\partial \phi} \right |}
$$
to arrive at a system of linear equations relating the unit vectors in spherical and in Cartesian coordinates. Then define an arbitrary vector ##\mathbf{A}## written in spherical coordinate, ##\mathbf{A} = A_r \hat{e}_r + A_\theta \hat{e}_\theta + A_\phi \hat{e}_\phi##. Substitute the spherical coordinate unit vectors in terms of the Cartesian unit vectors using the relations you just derived.
 
  • Like
Likes TheArun
  • #3
Which relation to use to find the partial derivatives for finding each unit vectors?
Is it r^2 = x^2 + y^2 + z^2 ?
 
  • #4
##\mathbf{r}## is a position vector, thus ##\mathbf{r} = x\hat{e}_x + y\hat{e}_y + z\hat{e}_z##. Then express ##x##, ##y##, and ##z## in terms of ##r##, ##\theta##, and ##\phi##.
 
  • Like
Likes TheArun
  • #5
Sorry, Iam not able to reach a such relations. Can u please tell what the relations are?
 
  • #6
Which relations can you not reach? If you mean the definitions of unit vectors in post #2, as I hinted before, ##\mathbf{r}## is a position vector. Taking derivative like ##
\frac{\partial \mathbf{r}}{\partial r}## is done by simply substituting the component-expanded expression of ##\mathbf{r}## as given in post #4 into the derivative. Thus
$$
\frac{\partial \mathbf{r}}{\partial r} = \frac{\partial}{\partial r} \left( x\hat{e}_x + y\hat{e}_y + z\hat{e}_z \right)
$$
First try to calculate ##\frac{\partial \mathbf{r}}{\partial r}## and let's see what you will get.
 
  • Like
Likes TheArun
  • #7
Ya thanks.
So here is what i have done,
Taking r = rcos@cos# ex + rsin@sin# ey + rcos@ ez
I calculated the partials with respect to r, @ and # from these.

r/∂r = cos@cos# ex + sin@sin# ey + cos@ ez
|∂r/∂r| = √cos2@cos2# +sin2sin2# + cos2@

Likewise, i have arrived at the partials and magnitude of other components...
As the next step, i guess i have to substitute this into the A vector expression you have mentioned in post#2 after finding unit vector er,e@, and e#...i hope I am not missing anything?
 
  • #8
TheArun said:
cos@cos# ex
Check again whether there should be sine or cosine.
TheArun said:
|∂r/∂r| = √cos2@cos2# +sin2sin2# + cos2@
After incorporating the correction I suggested above, you should get a simple answer for the magnitude.
TheArun said:
As the next step, i guess i have to substitute this into the A vector expression you have mentioned in post#2 after finding unit vector er,e@, and e#
Yes.
Then group the resulting terms according to the Cartesian unit vectors they contain.
 
  • Like
Likes TheArun
  • #9
So here is what i got after grouping the terms acc to cartesian unit vectors...whats next?
A = (Arsin@cos# + A@cos@cos# - A#sin#) ex + (Arsin@sin# + A@cos@sin# + A#cos#) ey + (Arcos@ -A@sin@) ez

Edit: Thanks i was able to complete the solution myself. Thanks for providing me hints and making me do it myself!

Can u also explain the meaning of unit vector in a particular direction being equal to derivative of the vector in that direction divided by the magnitude of that derivative
ie., er = ∂r/∂r / |∂r/∂r|

Thanks a lot for your help. I was not able to find the derivation of that transformation matrix from my books and couldn't find it online too..
 
Last edited:
  • #10
TheArun said:
A = (Arsin@cos# + A@cos@cos# - A#sin#) ex + (Arsin@sin# + A@cos@sin# + A#cos#) ey + (Arcos@ -A@sin@) ez
Please check again the terms marked as red.
 
  • #11
I was actually studying this inorder to find the spherical coordinates representation of the 'laplacian' of a vector( scalar electric potential)...how to reach into that form for here?
laplacian ∇2V = Vxx +Vyy + Vzz
must be converted to ∇2V = 1/r2 ∂/∂r(r2∂V/∂r) + ...
 
Last edited:
  • #12
blue_leaf77 said:
Please check again the terms marked as red.
Yeah checked it again from a book where only the matrix is given. The transformation matrix is actually same as that comes from the above expression.
 
  • #13
If you follow the derivation I suggested above, you will find something different. Could you possibly confuse the matrix transformation for the unit vectors with that of the components in that book? The two transformation matrices indeed look alike except for the third column.
 
  • #14
I followed the method u suggested only but still getting the same expression.
Here are equations cocerning the relevant terms:
dr/d# =-rsin#sin@ ex +rsin@cos# ey + 0 ez
|dr/d#| = rsin@
which gives,
e# = -sin# ex +cos# ey
And the matrix is,

[Ax] [sin@cos# cos@cos# -sin#] [Ar]
[Ay] = [sin@sin# cos@sin# cos#] [A@]
[Az] [cos@ -sin# 0] [A#]
 
  • #15
Sorry, my bad. I was switching to a different definition of unit vectors without realizing that it is different than the one I was previously using for writing the equations in post #2. So, you are correct.
TheArun said:
Can u also explain the meaning of unit vector in a particular direction being equal to derivative of the vector in that direction divided by the magnitude of that derivative
If you fix two coordinates among ##(r,\theta,\phi)## and let the last one varies, you will get the so-called "space curve" or the more technical term "3D curve". For example fix ##r## and ##\theta##, then you will get a space curve ##\mathbf{r}(\phi)## which forms a circle of radius ##r\sin \theta## "floating" horizontally above the ##xy## plane at a height of ##r\cos\theta##. Now, define a vector ##\mathbf{u} = \frac{d \mathbf{r}}{d s}##, where ##ds = r\sin\theta d\phi## is an element of arc length along the circle. Vector ##\mathbf{u}## is tangent to the circle, and its explicit expression is
$$
\mathbf{u} = \frac{d \mathbf{r}}{d s} = \frac{1}{r\sin\theta} \frac{d \mathbf{r}}{d\phi }
$$
But ##r\sin\theta## is the length of the vector ##\frac{d \mathbf{r}}{d\phi }## itself. Therefore one can write
$$
\mathbf{u} = \frac{\frac{d\mathbf{r}}{d\phi}}{ \left | \frac{d\mathbf{r}}{d\phi} \right |}
$$
Because ##\mathbf{u}## is tangent to the circle at any given point and it has unit length, this vector must be the unit vector in the direction of increasing ##\phi##.
TheArun said:
I was actually studying this inorder to find the spherical coordinates representation of the 'laplacian' of a vector( scalar electric potential)...how to reach into that form for here?
laplacian ∇2V = Vxx +Vyy + Vzz
must be converted to ∇2V = 1/r2 ∂/∂r(r2∂V/∂r) + ...
Such a task is of course doable but tedious. I suggest that you read "Mathematical Methods for Physics and Engineering" by K. F. Riley, Hobson, and Bence subchapter 10.10.
 
  • Like
Likes TheArun

1. What is a coordinate transformation from spherical to rectangular?

A coordinate transformation from spherical to rectangular is a mathematical process that converts coordinates from a spherical coordinate system to a rectangular coordinate system. This is often used in scientific fields such as astronomy, geodesy, and geography.

2. Why is a coordinate transformation necessary?

A coordinate transformation is necessary because different coordinate systems are used to represent the same location or point in space. By converting between coordinate systems, it allows for easier comparison and analysis of data gathered from different sources.

3. What are the main components of a spherical coordinate system?

The main components of a spherical coordinate system are the radial distance, polar angle, and azimuthal angle. The radial distance is the distance from the origin to the point, the polar angle is the angle from the positive z-axis, and the azimuthal angle is the angle from the positive x-axis in the xy-plane.

4. How is the conversion from spherical to rectangular coordinates performed?

The conversion from spherical to rectangular coordinates involves using trigonometric functions to calculate the x, y, and z coordinates in the rectangular system. The formulas for this transformation vary slightly depending on the specific coordinate system being used, but they all involve using the radial, polar, and azimuthal angles in some way.

5. What are some applications of coordinate transformation from spherical to rectangular?

Coordinate transformation from spherical to rectangular has many applications in science and engineering. Some examples include mapping and surveying, navigation systems, and modeling of celestial bodies. It is also commonly used in computer graphics and game development to convert between different coordinate systems for rendering and animation purposes.

Similar threads

Replies
1
Views
724
Replies
2
Views
1K
Replies
33
Views
3K
  • Calculus and Beyond Homework Help
Replies
7
Views
700
Replies
1
Views
2K
Replies
2
Views
4K
  • General Math
Replies
4
Views
1K
  • Electromagnetism
Replies
4
Views
806
Replies
40
Views
2K
  • Advanced Physics Homework Help
Replies
9
Views
2K
Back
Top