Generalised change of spherical coordinates
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I have a set of points in an equatorial coordinate system specified by a longitude, $0^circleqalpha < 360^circ$ and a latitude, $-90^circleq delta leq +90^circ$
I want to take a point with coordinates $(alpha_1,delta_1)$ and create a second coordinate system such that my point now has coordinates $(alpha_2,delta_2)$. I then want to apply that transformation to every point in the set.
Shifting in longitude with constant latitude is straightforward, the transformation is just $(alpha,delta)rightarrow(alpha+alpha_2-alpha_1,delta)$, but shifting in latitude is more complicated due to behaviour around the poles.
There's a similar question here that rotates the equator of the coordinate system to intersect with the point while preserving the points longitude (i.e. shifting latitude with constant longitude). There is definitely a way to generalise the top answer to that question so that it solves my problem, I just can't seem to figure it out.
I can imagine a series of transformations such that I shift $(alpha_1,delta_1)$ to $(0,delta_1)$ using the longtitude transformation I mention above, then use the solution to the other question to shift that to $(0,0)$, then use an inverse transformation to shift it to $(0,delta_2)$ and then finally a simple longitude transformation to shift it to $(alpha_2,delta_2)$.
However, that sounds like an overly complicated solution.
There should (hopefully!) be a way to do it with a single coordinate transformation, which would be preferable since I have to write this in Python and more transformations means more compute time. I'll be calculating and applying this transformation ~10,000 times to approximately 10 million points, so needlessly increasing the number of calculations has big flow-on effects.
geometry coordinate-systems transformation spherical-coordinates
add a comment |Â
up vote
1
down vote
favorite
I have a set of points in an equatorial coordinate system specified by a longitude, $0^circleqalpha < 360^circ$ and a latitude, $-90^circleq delta leq +90^circ$
I want to take a point with coordinates $(alpha_1,delta_1)$ and create a second coordinate system such that my point now has coordinates $(alpha_2,delta_2)$. I then want to apply that transformation to every point in the set.
Shifting in longitude with constant latitude is straightforward, the transformation is just $(alpha,delta)rightarrow(alpha+alpha_2-alpha_1,delta)$, but shifting in latitude is more complicated due to behaviour around the poles.
There's a similar question here that rotates the equator of the coordinate system to intersect with the point while preserving the points longitude (i.e. shifting latitude with constant longitude). There is definitely a way to generalise the top answer to that question so that it solves my problem, I just can't seem to figure it out.
I can imagine a series of transformations such that I shift $(alpha_1,delta_1)$ to $(0,delta_1)$ using the longtitude transformation I mention above, then use the solution to the other question to shift that to $(0,0)$, then use an inverse transformation to shift it to $(0,delta_2)$ and then finally a simple longitude transformation to shift it to $(alpha_2,delta_2)$.
However, that sounds like an overly complicated solution.
There should (hopefully!) be a way to do it with a single coordinate transformation, which would be preferable since I have to write this in Python and more transformations means more compute time. I'll be calculating and applying this transformation ~10,000 times to approximately 10 million points, so needlessly increasing the number of calculations has big flow-on effects.
geometry coordinate-systems transformation spherical-coordinates
I would step back and examine why you want to do this. I think the question you linked to made assumptions that made the problem harder; perhaps you are doing that too.
– David K
Jul 26 at 3:01
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have a set of points in an equatorial coordinate system specified by a longitude, $0^circleqalpha < 360^circ$ and a latitude, $-90^circleq delta leq +90^circ$
I want to take a point with coordinates $(alpha_1,delta_1)$ and create a second coordinate system such that my point now has coordinates $(alpha_2,delta_2)$. I then want to apply that transformation to every point in the set.
Shifting in longitude with constant latitude is straightforward, the transformation is just $(alpha,delta)rightarrow(alpha+alpha_2-alpha_1,delta)$, but shifting in latitude is more complicated due to behaviour around the poles.
There's a similar question here that rotates the equator of the coordinate system to intersect with the point while preserving the points longitude (i.e. shifting latitude with constant longitude). There is definitely a way to generalise the top answer to that question so that it solves my problem, I just can't seem to figure it out.
I can imagine a series of transformations such that I shift $(alpha_1,delta_1)$ to $(0,delta_1)$ using the longtitude transformation I mention above, then use the solution to the other question to shift that to $(0,0)$, then use an inverse transformation to shift it to $(0,delta_2)$ and then finally a simple longitude transformation to shift it to $(alpha_2,delta_2)$.
However, that sounds like an overly complicated solution.
There should (hopefully!) be a way to do it with a single coordinate transformation, which would be preferable since I have to write this in Python and more transformations means more compute time. I'll be calculating and applying this transformation ~10,000 times to approximately 10 million points, so needlessly increasing the number of calculations has big flow-on effects.
geometry coordinate-systems transformation spherical-coordinates
I have a set of points in an equatorial coordinate system specified by a longitude, $0^circleqalpha < 360^circ$ and a latitude, $-90^circleq delta leq +90^circ$
I want to take a point with coordinates $(alpha_1,delta_1)$ and create a second coordinate system such that my point now has coordinates $(alpha_2,delta_2)$. I then want to apply that transformation to every point in the set.
Shifting in longitude with constant latitude is straightforward, the transformation is just $(alpha,delta)rightarrow(alpha+alpha_2-alpha_1,delta)$, but shifting in latitude is more complicated due to behaviour around the poles.
There's a similar question here that rotates the equator of the coordinate system to intersect with the point while preserving the points longitude (i.e. shifting latitude with constant longitude). There is definitely a way to generalise the top answer to that question so that it solves my problem, I just can't seem to figure it out.
I can imagine a series of transformations such that I shift $(alpha_1,delta_1)$ to $(0,delta_1)$ using the longtitude transformation I mention above, then use the solution to the other question to shift that to $(0,0)$, then use an inverse transformation to shift it to $(0,delta_2)$ and then finally a simple longitude transformation to shift it to $(alpha_2,delta_2)$.
However, that sounds like an overly complicated solution.
There should (hopefully!) be a way to do it with a single coordinate transformation, which would be preferable since I have to write this in Python and more transformations means more compute time. I'll be calculating and applying this transformation ~10,000 times to approximately 10 million points, so needlessly increasing the number of calculations has big flow-on effects.
geometry coordinate-systems transformation spherical-coordinates
asked Jul 25 at 2:56
DDobie
61
61
I would step back and examine why you want to do this. I think the question you linked to made assumptions that made the problem harder; perhaps you are doing that too.
– David K
Jul 26 at 3:01
add a comment |Â
I would step back and examine why you want to do this. I think the question you linked to made assumptions that made the problem harder; perhaps you are doing that too.
– David K
Jul 26 at 3:01
I would step back and examine why you want to do this. I think the question you linked to made assumptions that made the problem harder; perhaps you are doing that too.
– David K
Jul 26 at 3:01
I would step back and examine why you want to do this. I think the question you linked to made assumptions that made the problem harder; perhaps you are doing that too.
– David K
Jul 26 at 3:01
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
A transformation from one coordinate system on the sphere to another one can be represented by a rotation about the centre of the sphere. The rotations about a point form a group. Thus, composing any two rotations again yields a rotation. Thus, you don't have to worry about the number of rotations you use to perform the transformation; you can express them all as matrices and multiply all the matrices to get a single matrix to apply. Then you can transform your points to Cartesian coordinates, apply the one matrix and transform them back to spherical coordinates.
The sequence of transformations you describe is one good way to solve the problem, by representing the rotation as the product of three rotations about coordinate axes. You can also construct a single rotation directly if you prefer. There's a continuum of rotations that transform a given point into a given other point; any axis that's equidistant from the two points will do. The two ends of this continuum are easier to construct than the rest. Transform the points to vectors in Cartesian coordinates. To rotate through the least possible angle, take the cross product as the axis and the angle between the vectors as the angle. To rotate through the greatest possible angle, take the midpoint (half the sum) as the axis and $pi$ as the angle. See Rodrigues' rotation formula on how to build a rotation matrix given an axis and an angle.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
A transformation from one coordinate system on the sphere to another one can be represented by a rotation about the centre of the sphere. The rotations about a point form a group. Thus, composing any two rotations again yields a rotation. Thus, you don't have to worry about the number of rotations you use to perform the transformation; you can express them all as matrices and multiply all the matrices to get a single matrix to apply. Then you can transform your points to Cartesian coordinates, apply the one matrix and transform them back to spherical coordinates.
The sequence of transformations you describe is one good way to solve the problem, by representing the rotation as the product of three rotations about coordinate axes. You can also construct a single rotation directly if you prefer. There's a continuum of rotations that transform a given point into a given other point; any axis that's equidistant from the two points will do. The two ends of this continuum are easier to construct than the rest. Transform the points to vectors in Cartesian coordinates. To rotate through the least possible angle, take the cross product as the axis and the angle between the vectors as the angle. To rotate through the greatest possible angle, take the midpoint (half the sum) as the axis and $pi$ as the angle. See Rodrigues' rotation formula on how to build a rotation matrix given an axis and an angle.
add a comment |Â
up vote
0
down vote
A transformation from one coordinate system on the sphere to another one can be represented by a rotation about the centre of the sphere. The rotations about a point form a group. Thus, composing any two rotations again yields a rotation. Thus, you don't have to worry about the number of rotations you use to perform the transformation; you can express them all as matrices and multiply all the matrices to get a single matrix to apply. Then you can transform your points to Cartesian coordinates, apply the one matrix and transform them back to spherical coordinates.
The sequence of transformations you describe is one good way to solve the problem, by representing the rotation as the product of three rotations about coordinate axes. You can also construct a single rotation directly if you prefer. There's a continuum of rotations that transform a given point into a given other point; any axis that's equidistant from the two points will do. The two ends of this continuum are easier to construct than the rest. Transform the points to vectors in Cartesian coordinates. To rotate through the least possible angle, take the cross product as the axis and the angle between the vectors as the angle. To rotate through the greatest possible angle, take the midpoint (half the sum) as the axis and $pi$ as the angle. See Rodrigues' rotation formula on how to build a rotation matrix given an axis and an angle.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
A transformation from one coordinate system on the sphere to another one can be represented by a rotation about the centre of the sphere. The rotations about a point form a group. Thus, composing any two rotations again yields a rotation. Thus, you don't have to worry about the number of rotations you use to perform the transformation; you can express them all as matrices and multiply all the matrices to get a single matrix to apply. Then you can transform your points to Cartesian coordinates, apply the one matrix and transform them back to spherical coordinates.
The sequence of transformations you describe is one good way to solve the problem, by representing the rotation as the product of three rotations about coordinate axes. You can also construct a single rotation directly if you prefer. There's a continuum of rotations that transform a given point into a given other point; any axis that's equidistant from the two points will do. The two ends of this continuum are easier to construct than the rest. Transform the points to vectors in Cartesian coordinates. To rotate through the least possible angle, take the cross product as the axis and the angle between the vectors as the angle. To rotate through the greatest possible angle, take the midpoint (half the sum) as the axis and $pi$ as the angle. See Rodrigues' rotation formula on how to build a rotation matrix given an axis and an angle.
A transformation from one coordinate system on the sphere to another one can be represented by a rotation about the centre of the sphere. The rotations about a point form a group. Thus, composing any two rotations again yields a rotation. Thus, you don't have to worry about the number of rotations you use to perform the transformation; you can express them all as matrices and multiply all the matrices to get a single matrix to apply. Then you can transform your points to Cartesian coordinates, apply the one matrix and transform them back to spherical coordinates.
The sequence of transformations you describe is one good way to solve the problem, by representing the rotation as the product of three rotations about coordinate axes. You can also construct a single rotation directly if you prefer. There's a continuum of rotations that transform a given point into a given other point; any axis that's equidistant from the two points will do. The two ends of this continuum are easier to construct than the rest. Transform the points to vectors in Cartesian coordinates. To rotate through the least possible angle, take the cross product as the axis and the angle between the vectors as the angle. To rotate through the greatest possible angle, take the midpoint (half the sum) as the axis and $pi$ as the angle. See Rodrigues' rotation formula on how to build a rotation matrix given an axis and an angle.
answered Jul 25 at 5:07
joriki
164k10180328
164k10180328
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2861978%2fgeneralised-change-of-spherical-coordinates%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
I would step back and examine why you want to do this. I think the question you linked to made assumptions that made the problem harder; perhaps you are doing that too.
– David K
Jul 26 at 3:01