Hello,
I am working on a program that draws lines by converting spherical coordinates into cartesian coordinates. I use the following equations to calculate the cartesian coordinates of a point based on its distance, azimuthal angle, and polar angle from another point.
The y axis is vertical, x and z are horizontal.
x_{2}=x_{1}+distance*sin(azimuth)*cos(polar)
y_{2}=y_{1}+distance*cos(azimuth)
z_{2}=z_{1}+distance*sin(azimuth)*sin(polar)
What I would like to be able to do is effectively rotate the 3 dimensional space by a given azimuth and polar angle, and use a similar set of equations to calculate the cartesian coordinates in the original x,y,z space, of a point based on its distance, azimuthal angle, and polar angle, relative to the rotated space, to another point.
So there would be 5 known variables:
the azimuthal angle of rotation of the 3d space
the polar angle of rotation of the 3d space
the distance from point 1 to point 2
the azimuth angle (in the rotated space) from point 1 to point 2
the polar angle (in the rotated space) from point 1 to point 2
Of course we would also know the coordinates of the starting point
Here is a picture to help clarify.
The yellow lines represent the original axes, the blue lines represent the axes after rotation, the pink line is the line between point 1 and point 2.
In this case, the space has been rotated 30 degrees polar and 60 degrees azimuth. Point 2 lies a distance of 1, an azimuth angle of 45 degrees, and a polar angle of 45 degrees, relative to the rotated space, from point 1(in this case point 1 is the origin).
So how can I find the cartesian coordinates, in the unrotated space, of point 2 with this information?
I am working on a program that draws lines by converting spherical coordinates into cartesian coordinates. I use the following equations to calculate the cartesian coordinates of a point based on its distance, azimuthal angle, and polar angle from another point.
The y axis is vertical, x and z are horizontal.
x_{2}=x_{1}+distance*sin(azimuth)*cos(polar)
y_{2}=y_{1}+distance*cos(azimuth)
z_{2}=z_{1}+distance*sin(azimuth)*sin(polar)
What I would like to be able to do is effectively rotate the 3 dimensional space by a given azimuth and polar angle, and use a similar set of equations to calculate the cartesian coordinates in the original x,y,z space, of a point based on its distance, azimuthal angle, and polar angle, relative to the rotated space, to another point.
So there would be 5 known variables:
the azimuthal angle of rotation of the 3d space
the polar angle of rotation of the 3d space
the distance from point 1 to point 2
the azimuth angle (in the rotated space) from point 1 to point 2
the polar angle (in the rotated space) from point 1 to point 2
Of course we would also know the coordinates of the starting point
Here is a picture to help clarify.
The yellow lines represent the original axes, the blue lines represent the axes after rotation, the pink line is the line between point 1 and point 2.
In this case, the space has been rotated 30 degrees polar and 60 degrees azimuth. Point 2 lies a distance of 1, an azimuth angle of 45 degrees, and a polar angle of 45 degrees, relative to the rotated space, from point 1(in this case point 1 is the origin).
So how can I find the cartesian coordinates, in the unrotated space, of point 2 with this information?
Attachments

25.3 KB Views: 4
Last edited: