Help with conversion from rectangular to spherical coordinates

Click For Summary

Discussion Overview

The discussion revolves around the conversion of vectors from rectangular to spherical coordinates, specifically focusing on the cross product of two vectors, \(\vec B\) and \(\vec C\), and the resulting vector \(\vec A\). Participants explore the calculations involved in determining the angles and components in spherical coordinates, as well as the implications of different approaches to the cross product.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant describes their setup of vectors \(\vec B\) and \(\vec C\) with specific angles and coordinates, aiming to find \(\vec A\) in spherical coordinates.
  • Another participant challenges the calculation of the angle \(\theta\) based on the tangent function, suggesting a reconsideration of the sign convention used.
  • A participant clarifies that in spherical coordinates, \(\theta\) should be greater than 90 degrees when \(z\) is negative, supporting their angle calculation using the cosine function.
  • A participant identifies a sign mistake in their calculations that led to an incorrect conclusion about the \(\hat{\theta}\) component being non-zero.
  • One participant outlines two different approaches to calculating the cross product, noting that they yield different results, which raises questions about the validity of the methods used.
  • The first approach involves performing the cross product in rectangular coordinates before converting to spherical coordinates, while the second approach transforms both vectors to spherical coordinates first.
  • Participants discuss the implications of obtaining different results from the two approaches, questioning the consistency of the cross product operation in spherical coordinates.

Areas of Agreement / Disagreement

There is no consensus on the correct approach to the cross product in spherical coordinates, as participants present competing views and calculations that lead to different results. Some participants agree on the need to clarify the angle calculations, while others focus on the implications of the differing methods for the cross product.

Contextual Notes

Participants express uncertainty regarding the assumptions made in their calculations, particularly concerning the sign conventions for angles and the treatment of components in spherical coordinates. The discussion highlights the complexity of converting between coordinate systems and the potential for errors in mathematical reasoning.

yungman
Messages
5,741
Reaction score
291
This is not a homework. Actual this is part of my own exercise on conversion where [itex]\vec A = \vec B \;X\; \vec C[/itex] and I intentionally set up B and C so the [itex]\theta_B \hbox { and } \theta_C \;=\; 60^o \;[/itex] respect to z-axis:

[tex]\vec B_{(x,y,z)} = (2,4, 2\sqrt{(\frac 5 3)}) \;\;\hbox { and }\;\; \vec C = (4,2, 2\sqrt{(\frac 5 3)})[/tex]

[tex]\vec A_{(x,y,z)} = \hat x 4\sqrt{\frac 5 3} \;+\; \hat y 4\sqrt{\frac 5 3} -\hat z 12[/tex]

I want to find A in spherical coordinate:

[tex]|\vec A_{(x,y,z)}| = \sqrt { x_A^2 +y_A^2 +z_A^2} = \sqrt{ 16\frac 5 3 \;+\; 16\frac 5 3 \;+\; 144} \;=\;14.04754[/tex]

[tex]\phi = tan^{-1} (\frac y x) \;=\; 45^o \;\;\hbox { and }\;\; \theta = tan{-1}(\frac {\sqrt{x^2+y^2}}{z}) = tan{-1}(\frac {7.30297}{-12}) = -31.324^o \Rightarrow \theta = 180-31.324=148.676^o[/tex]

Or using cosine to find [itex]\theta[/itex]:

[tex]\theta = cos ^{-1}(\frac { z}{|\vec A|}) = cos ^{-1}( \frac {-12}{14.04754})= 148.676^o[/tex]

[tex]\Rightarrow \; cos \phi = sin\phi = 0.7071 \;\;\hbox { and }\;\; cos \theta = -0.85424 \;\;\hbox { and }\;\; sin \theta = 0.5198[/tex]



Given equation of the [itex]\hat {\theta}[/itex] component:

[tex]A_{\theta} \;=\; A_x cos \theta cos \phi \;+\; A_y cos \theta sin\phi \;-\; A_z sin \theta[/tex]

[tex]\Rightarrow\; A_{\theta} \;=\; 4\sqrt{\frac 5 3} X (-0.85824) X 0.7071 \;+\; 4\sqrt{\frac 5 3} X (-0.85824) X 0.7071 \;-\;12 X (0.5198) \;=\; -6.23843 -6.2376 \;=\; -12.476[/tex]

For a position vector:

[tex]\vec A \;=\; \hat R A_R[/tex]

Both [itex]A_{\theta } \;\;\hbox { and }\;\; A_{\phi} \;=\;0[/itex], no exception! But as you can see, [itex]A_{\theta }[/itex] is not zero. I double check my work, I cannot see any error. Please tell me what am I missing.

Thanks
 
Last edited:
Physics news on Phys.org
hi yungman! :smile:
yungman said:
[tex]\theta = tan{-1}(\frac {\sqrt{x^2+y^2}}{z}) = tan{-1}(\frac {7.30297}{-12}) = -31.324^o \Rightarrow \theta = 180-31.324=148.676^o[/tex]

nooo :redface:

tan-1(-A) = -tan-1(A) :wink:
 
tiny-tim said:
hi yungman! :smile:


nooo :redface:

tan-1(-A) = -tan-1(A) :wink:

Hi Tiny-Tim
Thanks for the reply.

But in Spherical coordiantes, [itex]\theta[/itex] is measure from the z-axis, when z=-12, [itex]\theta[/itex] has to be larger than 90 deg.

This is part of a conversion I am doing. where [itex]\vec A = \vec B X \vec C[/itex]. I just edit the original post to reflect this. I started with [itex]\theta[/itex] of both B and C are 60 deg. respect to z-axis.

Also another way to find the angles is:

[tex]\theta = cos ^{-1}(\frac { z}{|\vec A|}) = cos ^{-1} \frac {-12}{14.04754}= 148.676^o[/tex]
 
Last edited:
yungman said:
This is not a homework. Actual this is part of my own exercise on conversion where [itex]\vec A = \vec B \;X\; \vec C[/itex] and I intentionally set up B and C so the [itex]\theta_B \hbox { and } \theta_C \;=\; 60^o \;[/itex] respect to z-axis:

[tex]\vec B_{(x,y,z)} = (2,4, 2\sqrt{(\frac 5 3)}) \;\;\hbox { and }\;\; \vec C = (4,2, 2\sqrt{(\frac 5 3)})[/tex]

[tex]\vec A_{(x,y,z)} = \hat x 4\sqrt{\frac 5 3} \;+\; \hat y 4\sqrt{\frac 5 3} -\hat z 12[/tex]

I want to find A in spherical coordinate:

[tex]|\vec A_{(x,y,z)}| = \sqrt { x_A^2 +y_A^2 +z_A^2} = \sqrt{ 16\frac 5 3 \;+\; 16\frac 5 3 \;+\; 144} \;=\;14.04754[/tex]

[tex]\phi = tan^{-1} (\frac y x) \;=\; 45^o \;\;\hbox { and }\;\; \theta = tan{-1}(\frac {\sqrt{x^2+y^2}}{z}) = tan{-1}(\frac {7.30297}{-12}) = -31.324^o \Rightarrow \theta = 180-31.324=148.676^o[/tex]

Or using cosine to find [itex]\theta[/itex]:

[tex]\theta = cos ^{-1}(\frac { z}{|\vec A|}) = cos ^{-1}( \frac {-12}{14.04754})= 148.676^o[/tex]

[tex]\Rightarrow \; cos \phi = sin\phi = 0.7071 \;\;\hbox { and }\;\; cos \theta = -0.85424 \;\;\hbox { and }\;\; sin \theta = 0.5198[/tex]



Given equation of the [itex]\hat {\theta}[/itex] component:

[tex]A_{\theta} \;=\; A_x cos \theta cos \phi \;+\; A_y cos \theta sin\phi \;-\; A_z sin \theta[/tex]

[tex]\Rightarrow\; A_{\theta} \;=\; 4\sqrt{\frac 5 3} X (-0.85824) X 0.7071 \;+\; 4\sqrt{\frac 5 3} X (-0.85824) X 0.7071 \;-\;12 X (0.5198) \;=\; -6.23843 -6.2376 \;=\; -12.476[/tex]

For a position vector:

[tex]\vec A \;=\; \hat R A_R[/tex]

Both [itex]A_{\theta } \;\;\hbox { and }\;\; A_{\phi} \;=\;0[/itex], no exception! But as you can see, [itex]A_{\theta }[/itex] is not zero. I double check my work, I cannot see any error. Please tell me what am I missing.

Thanks

I found my problem. It is a stupid sign mistake.

[tex]\Rightarrow\; A_{\theta} \;=\; 4\sqrt{\frac 5 3} X (-0.85824) X 0.7071 \;+\; 4\sqrt{\frac 5 3} X (-0.85824) X 0.7071 \;-\;(-12) X (0.5198) \;=\; -6.23843 +6.2376 \;=\; 0[/tex]

The z term is where my error is. Thanks.
 
Ok, now that I got over the stupid thing I did. I can get back to my main experiment. My goal is to compare the result of:

[tex]\vec B \;X \;\vec C \;=\; \vec A[/tex]

I use two different approaches and proof that they don't get the same answer. The approaches are:

a) By perform the cross product in rectangular coordinates and then transform into spherical coordinates as show in the original post #1.

b) By transform both B and C first into spherical coordinate before perform cross product.



a) First approach: Refer to post #1:

[tex]A_R = \vec A_{(x,y,z)} \cdot \hat R \;=\; A_x sin \theta cos \phi \;+\; A_y sin \theta sin \phi \;+\; A_z cos \theta = 14.046926[/tex]

Both [itex]\vec A_{\theta}=\vec A_{\phi}=0[/itex] therefore:

[tex]\vec A \;=\; \hat R A_R \;=\; \hat R 14.046926[/tex]



b) Second approach: we transform both B and C to spherical coordinates before performing the cross product:
Using the same formula above, both [itex]\vec B_R = \vec C_R = \hat R 5.163746[/itex].

[tex]\vec B = \hat R B_R \;\;\hbox { and } \;\; \vec C = \hat R C_R[/tex]


As you can see, both only has the [itex]\hat R[/itex] components only as expected from a position vector.

[tex]\vec B \;X\; \vec C \;=\; \left|\begin{array}{ccc}\hat R & \hat \theta & \hat \phi \\B_R & 0 & 0\\ C_R & 0 & 0\end{array}\right|= 0[/tex]

This imply you get a total different answer in two different procedures. It is my understanding you can perform the cross product either way but obviously it does not work. Please take a look and see what did I do wrong.

Thanks

Alan
 
Last edited:

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 33 ·
2
Replies
33
Views
5K
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K