# Math Help - Converting Cartersian coordinate term to spherical

1. ## Converting Cartersian coordinate term to spherical

I am working through a problem where the vector has a Cartesian term and want to convert it to spherical::
(Sorry, I couldn't figure out how to use the equation editor)

sqrt(x^2+y^2)/sqrt(X^2+y^2+z^2) (x component of vector)

I know:
r=sqrt(x^2+y^2+z^2)
x=rsin\theta cos\phi
y=rsin\theta sin\phi
z=rcos\theta

I also know the answer is:
(rsin\phi )/r = sin\phi

I can't figure out how rsin\phi = sqrt(x^2=y^2) in the answer.

2. Originally Posted by laguna92651
I am working through a problem where the vector has a Cartesian term and want to convert it to spherical::
(Sorry, I couldn't figure out how to use the equation editor)

sqrt(x^2+y^2)/sqrt(X^2+y^2+z^2) (x component of vector)

I know:
r=sqrt(x^2+y^2+z^2)
x=rsin\theta cos\phi
y=rsin\theta sin\phi
z=rcos\theta

I also know the answer is:
(rsin\phi )/r = sin\phi

I can't figure out how rsin\phi = sqrt(x^2=y^2) in the answer.

How this is possible that the first red is NOT an equation and the second red is an equation?

3. The second red, just goes one step further to simplify the answer.

4. Originally Posted by laguna92651
The second red, just goes one step further to simplify the answer.
Let me put my question in other words, where is the "=" sign in the first red?

5. I'll ask the question is way, how did the left convert to the right side? Cartesian to spherical

sqrt(x^2+y^2)/sqrt(X^2+y^2+z^2) = [r(sin(phi) ]/r

6. Originally Posted by laguna92651
I'll ask the question is way, how did the left convert to the right side? Cartesian to spherical

sqrt(x^2+y^2)/sqrt(X^2+y^2+z^2) = [r(sin(phi) ]/r
sqrt(x^2+ y^2+ z^2)= r. that's where the denominator on the right comes from.

x= r cos(theta) sin(phi), y= r sin(theta) sin(phi) so x^2= r^2 cos^2(\theta) sin^2(phi) and y^2= r^2 sin^2(\theta) sin^2(\phi).

x^2+ y^2= r^2 cos^2(theta) sin^2(phi)+ r^2 sin^2(theta) cos^2(phi)= r^2 sin^2(phi)(cos^2(theta)+ sin^2(theta))
= r^2 sin^2(\phi). That's the numerator.

7. Thanks for the help.

Did you mean for the second term in the x^2+y^2 equation to be sin^2(phi) instead of cos^2(phi)?
Second term: r^2 sin^2(theta) cos^2(phi)

You used; x= r cos(theta) sin(phi)
My electromagnetics book uses; x= r cos(phi) sin(theta)

So I get sin(theta) as an answer, the correct answer is sin(phi). Am I missing something?

Theta is defined as the angle between the z-axis the position vector.
Phi is measured from the x-axis to the plane of the vector.