Why is ##x = r \sin{\phi} \cos{\theta}## in spherical coordinates?

In summary, the conversation is about the conversion between spherical coordinates and cartesian coordinates. The angles ##\phi## and ##\theta## are defined and used in the conversion. The question is raised about the notation for ##x## in the conversion formula, and whether the length ##r \sin{\phi}## can be negative. It is explained that this is allowed in certain conventions and contexts. The conversation also touches on the restrictions for the ranges of ##\phi## and ##\theta## in spherical coordinates.
  • #1
PFuser1232
479
20
My question is really about converting between spherical coordinates and cartesian coordinates.
Suppose that ##\phi## and ##\theta## are defined as follows:
##\phi## is the angle between the position vector of a point and the ##z##-axis. ##\theta## is the angle between the projection of that vector onto the ##xy##-plane and the ##x##-axis.
Why exactly do we write ##x = r \sin{\phi} \cos{\theta}##?
I know that we first project the position vector onto the ##xy##-plane before projecting that projection onto the ##x##-axis. But if that were the case, shouldn't we write ##x = |r \sin{\phi}| \cos{\theta}##?
I'm confused because the quantity ##r \sin{\phi}## is, on occasion, negative. I thought we're only allowed to project "lengths" or "positive scalars". I am fully aware of the fact that the projection can itself be negative, but the whole notion that the length (not the final projection) which is to be projected can be negative isn't so intuitive.
Take for example a circle of radius ##r## centred at the origin. I'll define ##t## as the angle made with the ##x##-axis. ##x = r \cos{\theta}##. ##x## is allowed to be positive or negative, but ##r## is always positive.
 
Mathematics news on Phys.org
  • #2
##\phi## is only defined on the domain ##0<\phi<\pi/2## so ##\sin(\phi) \ge 0##
 
  • #3
Khashishi said:
##\phi## is only defined on the domain ##0<\phi<\pi/2## so ##\sin(\phi) \ge 0##

Isn't the choice of the interval somewhat arbitrary?
When dealing with polar coordinates for instance, we work on either ##(-\pi, \pi]## or ##[0, 2\pi)##.
 
  • #4
Well, that's the standard convention. You can choose another convention if you want, but you'll have to deal with ##\sin(\phi) < 0## somehow, so the standard convention makes a lot of sense.
 
  • Like
Likes PFuser1232
  • #5
Khashishi said:
Well, that's the standard convention. You can choose another convention if you want, but you'll have to deal with ##\sin(\phi) < 0## somehow, so the standard convention makes a lot of sense.

Thanks!
But am I correct in assuming that projecting a "negative length" is meaningless?
Also, I believe the domain you are talking about is ##0 \leq \phi \leq \pi##, not ##0 \leq \phi \leq \frac{\pi}{2}##.
 
  • #6
MohammedRady97 said:
Also, I believe the domain you are talking about is ##0 \leq \phi \leq \pi##, not ##0 \leq \phi \leq \frac{\pi}{2}##.
Oops!

In some situations, you can interpret a negative length as a length in the opposite direction.
 
  • #7
Khashishi said:
Oops!

In some situations, you can interpret a negative length as a length in the opposite direction.

Well, yeah. But not in this particular example, right?
 
  • #8
Given the spherical coordinates as you say, the z coordinate is easy. If we draw a line from the given point perpendicular to the z-axis, [itex]\phi[/itex] is the angle in a right triangle having the straight line from the origin to the point, of length [itex]\rho[/itex], as hypotenuse and the height above the xy-plane as "near side": so [itex]z= \rho cos(\phi)[/itex].

Now consider the projection of that point in the xy-plane, (x, y, 0). The straight line from the origin to (x, y, 0) is the "opposite side" to [itex]\phi[/itex] of a right triangle having [itex]\rho[/itex] as hypotenuse- its length is [itex]\rho sin(\phi)[/itex]. And that line is the hypotenuse of a right triangle in the xy-plane with angle [itex]\theta[/itex] and "near side" of length x, "opposite side" of length y. [itex]x/r= cos(\theta)[/itex] so [itex]x= r cos(\theta)= \rho sin(\phi) cos(\theta)[/itex] and [itex]y/r= sin(\theta)[/itex] so [itex]y= r sin(\theta)= \rho sin(\phi)sin(\theta)[/itex].
 
  • Like
Likes PFuser1232
  • #9
HallsofIvy said:
Given the spherical coordinates as you say, the z coordinate is easy. If we draw a line from the given point perpendicular to the z-axis, [itex]\phi[/itex] is the angle in a right triangle having the straight line from the origin to the point, of length [itex]\rho[/itex], as hypotenuse and the height above the xy-plane as "near side": so [itex]z= \rho cos(\phi)[/itex].

Now consider the projection of that point in the xy-plane, (x, y, 0). The straight line from the origin to (x, y, 0) is the "opposite side" to [itex]\phi[/itex] of a right triangle having [itex]\rho[/itex] as hypotenuse- its length is [itex]\rho sin(\phi)[/itex]. And that line is the hypotenuse of a right triangle in the xy-plane with angle [itex]\theta[/itex] and "near side" of length x, "opposite side" of length y. [itex]x/r= cos(\theta)[/itex] so [itex]x= r cos(\theta)= \rho sin(\phi) cos(\theta)[/itex] and [itex]y/r= sin(\theta)[/itex] so [itex]y= r sin(\theta)= \rho sin(\phi)sin(\theta)[/itex].

And the length ##\rho \sin{\phi}## is always positive, right?
 
  • #10
[itex]\rho[/itex] itself is a distance so always positive. [itex]\phi[/itex] is between 0 and [itex]\pi[/itex] so [itex]sin(\phi)[/itex] is positive. Yes, their product, the product of positive numbers, is positive.
 
  • Like
Likes PFuser1232
  • #11
HallsofIvy said:
[itex]\rho[/itex] itself is a distance so always positive.
Per wikipedia, "always" is too strong.
It is also convenient, in many contexts, to allow negative radial distances, with the convention that (−r, θ, φ) is equivalent to (r, θ + 180°, φ) for any r, θ, and φ.
-- https://en.wikipedia.org/wiki/Spherical_coordinate_system

Note that for some reason they are using r instead of ##\rho##, which is more commonly used in spherical coordinates.
HallsofIvy said:
[itex]\phi[/itex] is between 0 and [itex]\pi[/itex] so [itex]sin(\phi)[/itex] is positive. Yes, their product, the product of positive numbers, is positive.
 
  • #12
HallsofIvy said:
[itex]\rho[/itex] itself is a distance so always positive. [itex]\phi[/itex] is between 0 and [itex]\pi[/itex] so [itex]sin(\phi)[/itex] is positive. Yes, their product, the product of positive numbers, is positive.

So unlike polar coordinates, ##\phi## is always restricted to be between 0 and ##\pi##.
 
  • #13
MohammedRady97 said:
So unlike polar coordinates, ##\phi## is always restricted to be between 0 and ##\pi##.
Not according to the same article whose link I posted earlier.
If it is necessary to define a unique set of spherical coordinates for each point, one may restrict their ranges. A common choice is:

r ≥ 0
0° ≤ θ ≤ 180° (π rad)
0° ≤ φ < 360° (2π rad)
However, the azimuth φ is often restricted to the interval (−180°, +180°], or (−π, +π] in radians, instead of [0, 360°). This is the standard convention for geographic longitude.
 
  • #14
Mark44 said:
Not according to the same article whose link I posted earlier.
Mark44 said:
Not according to the same article whose link I posted earlier.

Which brings me to my initial question; how can we project a "negative length" onto a plane?
 
  • #15
You can project a positive length onto a plane, right? The projection of a "negative length" would be just as long but would point in the opposite direction.
 
  • Like
Likes PFuser1232
  • #16
Mark44 said:
You can project a positive length onto a plane, right? The projection of a "negative length" would be just as long but would point in the opposite direction.
So, is it wrong to write ##x = |\rho \sin{\phi}| \cos{\theta}## (where ##\phi## is the angle between the position vector of a point and the ##z##-axis)?
 
  • #17
Yes, it is. What is correct is that [itex]x= \rho sin(\phi) cos(\theta)[/itex]. There should be no absolute value since x, which is a coordinate, not a distance, can be negative.
 
  • #18
HallsofIvy said:
Yes, it is. What is correct is that [itex]x= \rho sin(\phi) cos(\theta)[/itex]. There should be no absolute value since x, which is a coordinate, not a distance, can be negative.
It could still be negative if ##x = |\rho \sin{\phi}| \cos{θ}##; there are no absolute value bars around ##\cos{θ}##.
 
  • #19
Right. I should have said that the absolute value bars are not necessary here. [itex]\rho[/itex], a distance, is always positive and since [itex]\phi[/itex] lies between 0 and [itex]\pi[/itex], [itex]sin(\phi)[/itex] is always positive [itex]\rho sin(\phi)[/itex] cannot be negative..
 
  • #20
HallsofIvy said:
Right. I should have said that the absolute value bars are not necessary here. [itex]\rho[/itex], a distance, is always positive and since [itex]\phi[/itex] lies between 0 and [itex]\pi[/itex], [itex]sin(\phi)[/itex] is always positive [itex]\rho sin(\phi)[/itex] cannot be negative..
For what it's worth, and to repeat what I said in post #11, wikipedia disagrees that ##\rho## is always positive -- https://en.wikipedia.org/wiki/Spherical_coordinate_system
 
  • #21
Mark44 said:
For what it's worth, and to repeat what I said in post #11, wikipedia disagrees that ##\rho## is always positive -- https://en.wikipedia.org/wiki/Spherical_coordinate_system
How do we define ##\phi## anyway? I thought the concept of "positive - counterclockwise, negative - clockwise" only makes sense in a plane, not in three dimensional space.
 
  • #22
MohammedRady97 said:
How do we define ##\phi## anyway? I thought the concept of "positive - counterclockwise, negative - clockwise" only makes sense in a plane, not in three dimensional space.
##\phi## is the angle between the z-axis and the ray along which you measure ##\rho##. The z-axis and the ray define a plane.
 
  • #23
Mark44 said:
##\phi## is the angle between the z-axis and the ray along which you measure ##\rho##. The z-axis and the ray define a plane.
How do we define negative angles in that case?
 
  • #24
In this specific case, we don't. [itex]\phi[/itex] is always between 0 and [itex]\pi[/itex]. It is never negative.
 
  • Like
Likes PFuser1232
  • #25
HallsofIvy said:
In this specific case, we don't. [itex]\phi[/itex] is always between 0 and [itex]\pi[/itex]. It is never negative.
Is the Wikipedia article posted earlier by @Mark44 wrong about ##\rho## being negative in some cases?
 
  • #26
MohammedRady97 said:
Is the Wikipedia article posted earlier by @Mark44 wrong about ##\rho## being negative in some cases?
It's not always positive, it could be zero.
 
  • #27
The point is you can use any system for spherical coordinates as long as it is well defined. For instance every time you get in an aircraft you rely on a system which uses ±90° latitude, ±180° longitude and height above (or below, in which case you are in trouble) an approximately equipotential geoid.
 

What is the equation for converting from spherical coordinates to rectangular coordinates?

The equation for converting from spherical coordinates (##r, \phi, \theta##) to rectangular coordinates (##x, y, z##) is given by:
##x = r \sin{\phi} \cos{\theta}##
##y = r \sin{\phi} \sin{\theta}##
##z = r \cos{\phi}##

Why is ##x = r \sin{\phi} \cos{\theta}## in the equation for converting to rectangular coordinates?

This is because, in spherical coordinates, the radius (##r##) is the distance from the origin to the point, the angle (##\phi##) represents the angle from the positive z-axis to the point, and the angle (##\theta##) represents the angle from the positive x-axis to the point projected onto the xy-plane. Therefore, the x-coordinate is calculated by taking the projection of the point onto the xy-plane (##r \sin{\phi}##) and multiplying it by the cosine of the angle (##\theta##).

How does the equation change for converting to rectangular coordinates in 3D space?

The equation remains the same for converting to rectangular coordinates in 3D space. The only difference is that in 3D space, the z-coordinate is also calculated using the same equation as the x and y coordinates, instead of being given by ##r \cos{\phi}##.

Can the equation be simplified?

Yes, the equation can be simplified by using trigonometric identities. For example, we can write:
##x = r \sin{\phi} \cos{\theta} = \frac{1}{2} r (\sin{(\phi+\theta)} + \sin{(\phi-\theta)})##
This simplification can be useful in certain situations, but the original equation is generally preferred for its clarity and ease of use.

Are there other coordinate systems that use similar equations for conversion?

Yes, there are other coordinate systems that use similar equations for conversion, such as cylindrical coordinates (##r, \theta, z##) and polar coordinates (##r, \theta##). However, the specific equations used may differ slightly depending on the coordinate system and the conventions used.

Similar threads

Replies
2
Views
1K
Replies
33
Views
3K
  • General Math
Replies
4
Views
1K
  • Advanced Physics Homework Help
Replies
9
Views
2K
  • Calculus and Beyond Homework Help
Replies
3
Views
562
Replies
13
Views
2K
Replies
3
Views
3K
  • Advanced Physics Homework Help
Replies
4
Views
375
Replies
14
Views
2K
  • Introductory Physics Homework Help
Replies
7
Views
80
Back
Top