Cartesian to spherical polar coordinates

In summary, the conversation discusses the process of converting cartesian coordinates to spherical coordinates using the equations theta=arccos(z) and phi=arcsin(y/sin(theta)). The individual is seeking help in transforming the values to be in the range of 0 to 360 degrees instead of 0 to 180 degrees. They receive guidance on using quadrants and determining the value of phi based on the signs of x and y.
  • #1
birdhen
35
0
Hi there,
I am getting confused about how to work this out.
I know that to convert cartesian coordinates to spherical coordinates you can use:
theta=arccos(z)
phi=arcsin(y/sin(theta))

my problem is that I have a list of coordinates, let's call them THETA and PHI. I change them into X,Y,Z and then rotate them by 2 Euler angles.
THETA is in the range(0->2pi)
PHI is in the range (-pi/2->pi/2).

the problem is once I have completed the transforms I want the new value theta, As it is found using arccos the value returned is only in the range 0->pi, the values come back between 0 and 180, where as the THETA values are between 0 and 360, and therefore I want my transformed values to be in the range 0 to 360. I think I need to use quadrants but I have been searching the internet and can't find the info I need.

Any help would be greatly appreciated.
 
Mathematics news on Phys.org
  • #2
Hi birdhen! :smile:

(have a theta: θ and a phi: φ and a pi: π and a degree: º :wink:)
birdhen said:
theta=arccos(z)
phi=arcsin(y/sin(theta))

my problem is that I have a list of coordinates, let's call them THETA and PHI. I change them into X,Y,Z and then rotate them by 2 Euler angles.
THETA is in the range(0->2pi)
PHI is in the range (-pi/2->pi/2).

I normally do it the other way round …

θ from -π/2 to π/2, and φ from 0 to 2π …

then you have x = rsinθcosφ, y = rsinθsinφ, so you can use x as well as y to work out what φ is. :smile:
 
  • #3
ah, thank you,
so y/x=tanφ,
and the value of φ will depend on whether x and y are negative or positve.

Wonderful, that was the hint I needed,

Thank you!
 

1. What are Cartesian and spherical polar coordinates?

Cartesian coordinates are a system of representing points in a 3-dimensional space using x, y, and z axes. Spherical polar coordinates are another system that uses a radial distance, an angle from the z-axis, and an angle in the x-y plane to represent points in 3-dimensional space.

2. How do you convert from Cartesian to spherical polar coordinates?

To convert from Cartesian to spherical polar coordinates, you can use the following formulas:
r = √(x² + y² + z²)
θ = arctan(y/x)
φ = arccos(z/r)
where r is the radial distance, θ is the angle from the z-axis, and φ is the angle in the x-y plane.

3. What are the advantages of using spherical polar coordinates?

Spherical polar coordinates are useful in situations where the distance from a central point and the angles of rotation are important. They are also helpful in solving certain types of equations, such as those involving spherical symmetry.

4. Can you convert from spherical polar coordinates back to Cartesian coordinates?

Yes, you can convert from spherical polar coordinates back to Cartesian coordinates using the following formulas:
x = r * sin(φ) * cos(θ)
y = r * sin(φ) * sin(θ)
z = r * cos(φ)
where r is the radial distance, θ is the angle from the z-axis, and φ is the angle in the x-y plane.

5. What are some real-world applications of spherical polar coordinates?

Spherical polar coordinates are commonly used in fields such as physics, astronomy, and engineering. They are particularly useful in describing the motion of objects in space and in solving problems involving spherical geometries, such as the Earth's magnetic field or the motion of planets around the sun.

Similar threads

Replies
2
Views
1K
Replies
2
Views
1K
Replies
1
Views
1K
  • General Math
Replies
7
Views
1K
Replies
2
Views
1K
Replies
13
Views
2K
Replies
33
Views
3K
  • General Math
Replies
7
Views
2K
Replies
2
Views
4K
Replies
1
Views
2K
Back
Top