Combining two rotations
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
I'm working on a project, where I have to perform rotations of a point which is on the surface of a sphere of radius 1, around the center of the sphere.
In order to do so, I have a function, let's call it $U$, that is parametrized by 3 angles (real numbers) $theta$, $phi$ and $lambda$, and that performs the following operations on its input: it performs a rotation on $z$ of $phi$ radians, then a rotation over $y$ of $theta$ radians, and finally a last rotation, again on $z$, of $lambda$ radians.
In short: $U(theta, phi, lambda) := R_z(phi) R_y(theta) R_z(lambda)$.
Now here is my question: if I successively apply U with angles $theta_1, phi_1, lambda_1$, and then with other angles $theta_2, phi_2, lambda_2$, is there a method to find which angles $theta, phi, lambda$ would have led to the same rotation in only one application of the function, and if so, how ?
3d rotations
add a comment |Â
up vote
2
down vote
favorite
I'm working on a project, where I have to perform rotations of a point which is on the surface of a sphere of radius 1, around the center of the sphere.
In order to do so, I have a function, let's call it $U$, that is parametrized by 3 angles (real numbers) $theta$, $phi$ and $lambda$, and that performs the following operations on its input: it performs a rotation on $z$ of $phi$ radians, then a rotation over $y$ of $theta$ radians, and finally a last rotation, again on $z$, of $lambda$ radians.
In short: $U(theta, phi, lambda) := R_z(phi) R_y(theta) R_z(lambda)$.
Now here is my question: if I successively apply U with angles $theta_1, phi_1, lambda_1$, and then with other angles $theta_2, phi_2, lambda_2$, is there a method to find which angles $theta, phi, lambda$ would have led to the same rotation in only one application of the function, and if so, how ?
3d rotations
By $R_z(phi)$ do you mean $R_x(phi)$?
â Arnaud Mortier
11 hours ago
Yes, you can find a solution, but that might not be unique.
â Andrei
11 hours ago
Arnaud Mortier: No, it really is $R_z(phi)$. I am taking that $U$ function from a paper, and have to stick with it.
â 4rzael
9 hours ago
And @Andrei: The non-uniqueness of the result is not a problem (a deterministic solution to the problem would be preferable, in this case, though)
â 4rzael
9 hours ago
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I'm working on a project, where I have to perform rotations of a point which is on the surface of a sphere of radius 1, around the center of the sphere.
In order to do so, I have a function, let's call it $U$, that is parametrized by 3 angles (real numbers) $theta$, $phi$ and $lambda$, and that performs the following operations on its input: it performs a rotation on $z$ of $phi$ radians, then a rotation over $y$ of $theta$ radians, and finally a last rotation, again on $z$, of $lambda$ radians.
In short: $U(theta, phi, lambda) := R_z(phi) R_y(theta) R_z(lambda)$.
Now here is my question: if I successively apply U with angles $theta_1, phi_1, lambda_1$, and then with other angles $theta_2, phi_2, lambda_2$, is there a method to find which angles $theta, phi, lambda$ would have led to the same rotation in only one application of the function, and if so, how ?
3d rotations
I'm working on a project, where I have to perform rotations of a point which is on the surface of a sphere of radius 1, around the center of the sphere.
In order to do so, I have a function, let's call it $U$, that is parametrized by 3 angles (real numbers) $theta$, $phi$ and $lambda$, and that performs the following operations on its input: it performs a rotation on $z$ of $phi$ radians, then a rotation over $y$ of $theta$ radians, and finally a last rotation, again on $z$, of $lambda$ radians.
In short: $U(theta, phi, lambda) := R_z(phi) R_y(theta) R_z(lambda)$.
Now here is my question: if I successively apply U with angles $theta_1, phi_1, lambda_1$, and then with other angles $theta_2, phi_2, lambda_2$, is there a method to find which angles $theta, phi, lambda$ would have led to the same rotation in only one application of the function, and if so, how ?
3d rotations
asked 11 hours ago
4rzael
1112
1112
By $R_z(phi)$ do you mean $R_x(phi)$?
â Arnaud Mortier
11 hours ago
Yes, you can find a solution, but that might not be unique.
â Andrei
11 hours ago
Arnaud Mortier: No, it really is $R_z(phi)$. I am taking that $U$ function from a paper, and have to stick with it.
â 4rzael
9 hours ago
And @Andrei: The non-uniqueness of the result is not a problem (a deterministic solution to the problem would be preferable, in this case, though)
â 4rzael
9 hours ago
add a comment |Â
By $R_z(phi)$ do you mean $R_x(phi)$?
â Arnaud Mortier
11 hours ago
Yes, you can find a solution, but that might not be unique.
â Andrei
11 hours ago
Arnaud Mortier: No, it really is $R_z(phi)$. I am taking that $U$ function from a paper, and have to stick with it.
â 4rzael
9 hours ago
And @Andrei: The non-uniqueness of the result is not a problem (a deterministic solution to the problem would be preferable, in this case, though)
â 4rzael
9 hours ago
By $R_z(phi)$ do you mean $R_x(phi)$?
â Arnaud Mortier
11 hours ago
By $R_z(phi)$ do you mean $R_x(phi)$?
â Arnaud Mortier
11 hours ago
Yes, you can find a solution, but that might not be unique.
â Andrei
11 hours ago
Yes, you can find a solution, but that might not be unique.
â Andrei
11 hours ago
Arnaud Mortier: No, it really is $R_z(phi)$. I am taking that $U$ function from a paper, and have to stick with it.
â 4rzael
9 hours ago
Arnaud Mortier: No, it really is $R_z(phi)$. I am taking that $U$ function from a paper, and have to stick with it.
â 4rzael
9 hours ago
And @Andrei: The non-uniqueness of the result is not a problem (a deterministic solution to the problem would be preferable, in this case, though)
â 4rzael
9 hours ago
And @Andrei: The non-uniqueness of the result is not a problem (a deterministic solution to the problem would be preferable, in this case, though)
â 4rzael
9 hours ago
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
2
down vote
You can express rotations as matrices. Their combination is found by matrix multiplication.
In your case
it performs a rotation on $z$ of $phi$ radians, then a rotation over
$y$ of $theta$ radians, and finally a last rotation, again on $z$, of
$lambda$ radians.
we have:
beginalign
U
&= R_z(lambda) , R_y(theta) , R_z(phi) \
&=
beginpmatrix
coslambda & -sinlambda & 0 \
sinlambda & coslambda & 0 \
0 & 0 & 1
endpmatrix
beginpmatrix
costheta & 0 & -sintheta \
0 & 1 & 0 \
sintheta & 0 & costheta
endpmatrix
beginpmatrix
cosphi & -sinphi & 0 \
sinphi & cosphi & 0 \
0 & 0 & 1
endpmatrix
\
&=
beginpmatrix
coslambda & -sinlambda & 0 \
sinlambda & coslambda & 0 \
0 & 0 & 1
endpmatrix
beginpmatrix
costheta cosphi & -costheta sinphi & -sintheta \
sinphi & cosphi & 0 \
sintheta cosphi & -sintheta sinphi & costheta
endpmatrix
\
&=
beginpmatrix
coslambda costheta cosphi - sinlambda sinphi &
-coslambda costheta sinphi - sinlambda cosphi &
-coslambda sintheta \
sinlambda costheta cosphi + coslambda sinphi &
-sinlambda costheta sinphi + coslambda cosphi &
-sinlambda sintheta \
sintheta cosphi &
-sintheta sinphi &
costheta
endpmatrix
endalign
This results in a single $3 times 3$ matrix.
If you have two of those transformations $U_1$ and $U_2$ then the composition is given by the matrix product
$$
U_2 U_1
$$
One would have to calculate the resulting matrices and then check if it is possible to easily read the angles from the result.
I already did the matrix transformation, but have no clue how to read the angles from the resulting matrix
â 4rzael
9 hours ago
You can calculate $U_2 U_1$ for your given parameter sets and then try to fit that to a new matrix $U$. E.g. the last element is $cos theta$ and you should get the resulting $theta=arccos U_33$. Then use e.g. $U_23$ and $U_32$ to recover the resulting $lambda$ and $phi$. It is possible that there are several solutions.
â mvw
9 hours ago
Note that you have a sign issue. In the rotation matrix around $y$ axis the $+sin$ is in the upper corner.
â Andrei
9 hours ago
@Andrei: You could be right, if I compare to this. No I idea what 4rzael uses. I would suggest to check the calculation anyways. :-)
â mvw
9 hours ago
@mvw That's exactly what I was looking at :)
â Andrei
9 hours ago
add a comment |Â
up vote
0
down vote
A lot of details about this subject are in the Wikipedia article Euler angles. As an alternative, you can use
quaternions as in the Wikipedia article Quaternion and spatial rotations and just multiply two or more quaternions.
add a comment |Â
up vote
0
down vote
Start from the rotation matrix in terms of Euler angles. $$R(phi,theta,lambda)=beginpmatrixR_11& R_12 &R_13\R_21& R_22 &R_23\R_31& R_32 &R_33endpmatrix$$
First calculate the inner most angle. If $R_31$ and $R_32$ are both zero, use $lambda=0$. Otherwise $$tanlambda=fracR_32-R_31$$ You can use the $arctan2$ function
$$lambda=arctan2 (R_32,-R_31)$$
Now calculate $$R'(phi,theta)=R(phi,theta,lambda)R^-1_z(lambda)=R(phi,theta,lambda)R_z(-lambda)$$
If you do the calculations right, you get $phi=arctan2(-R'_12,R'_22)$
and $theta=arctan2(-R'_31,R'_33)$
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
You can express rotations as matrices. Their combination is found by matrix multiplication.
In your case
it performs a rotation on $z$ of $phi$ radians, then a rotation over
$y$ of $theta$ radians, and finally a last rotation, again on $z$, of
$lambda$ radians.
we have:
beginalign
U
&= R_z(lambda) , R_y(theta) , R_z(phi) \
&=
beginpmatrix
coslambda & -sinlambda & 0 \
sinlambda & coslambda & 0 \
0 & 0 & 1
endpmatrix
beginpmatrix
costheta & 0 & -sintheta \
0 & 1 & 0 \
sintheta & 0 & costheta
endpmatrix
beginpmatrix
cosphi & -sinphi & 0 \
sinphi & cosphi & 0 \
0 & 0 & 1
endpmatrix
\
&=
beginpmatrix
coslambda & -sinlambda & 0 \
sinlambda & coslambda & 0 \
0 & 0 & 1
endpmatrix
beginpmatrix
costheta cosphi & -costheta sinphi & -sintheta \
sinphi & cosphi & 0 \
sintheta cosphi & -sintheta sinphi & costheta
endpmatrix
\
&=
beginpmatrix
coslambda costheta cosphi - sinlambda sinphi &
-coslambda costheta sinphi - sinlambda cosphi &
-coslambda sintheta \
sinlambda costheta cosphi + coslambda sinphi &
-sinlambda costheta sinphi + coslambda cosphi &
-sinlambda sintheta \
sintheta cosphi &
-sintheta sinphi &
costheta
endpmatrix
endalign
This results in a single $3 times 3$ matrix.
If you have two of those transformations $U_1$ and $U_2$ then the composition is given by the matrix product
$$
U_2 U_1
$$
One would have to calculate the resulting matrices and then check if it is possible to easily read the angles from the result.
I already did the matrix transformation, but have no clue how to read the angles from the resulting matrix
â 4rzael
9 hours ago
You can calculate $U_2 U_1$ for your given parameter sets and then try to fit that to a new matrix $U$. E.g. the last element is $cos theta$ and you should get the resulting $theta=arccos U_33$. Then use e.g. $U_23$ and $U_32$ to recover the resulting $lambda$ and $phi$. It is possible that there are several solutions.
â mvw
9 hours ago
Note that you have a sign issue. In the rotation matrix around $y$ axis the $+sin$ is in the upper corner.
â Andrei
9 hours ago
@Andrei: You could be right, if I compare to this. No I idea what 4rzael uses. I would suggest to check the calculation anyways. :-)
â mvw
9 hours ago
@mvw That's exactly what I was looking at :)
â Andrei
9 hours ago
add a comment |Â
up vote
2
down vote
You can express rotations as matrices. Their combination is found by matrix multiplication.
In your case
it performs a rotation on $z$ of $phi$ radians, then a rotation over
$y$ of $theta$ radians, and finally a last rotation, again on $z$, of
$lambda$ radians.
we have:
beginalign
U
&= R_z(lambda) , R_y(theta) , R_z(phi) \
&=
beginpmatrix
coslambda & -sinlambda & 0 \
sinlambda & coslambda & 0 \
0 & 0 & 1
endpmatrix
beginpmatrix
costheta & 0 & -sintheta \
0 & 1 & 0 \
sintheta & 0 & costheta
endpmatrix
beginpmatrix
cosphi & -sinphi & 0 \
sinphi & cosphi & 0 \
0 & 0 & 1
endpmatrix
\
&=
beginpmatrix
coslambda & -sinlambda & 0 \
sinlambda & coslambda & 0 \
0 & 0 & 1
endpmatrix
beginpmatrix
costheta cosphi & -costheta sinphi & -sintheta \
sinphi & cosphi & 0 \
sintheta cosphi & -sintheta sinphi & costheta
endpmatrix
\
&=
beginpmatrix
coslambda costheta cosphi - sinlambda sinphi &
-coslambda costheta sinphi - sinlambda cosphi &
-coslambda sintheta \
sinlambda costheta cosphi + coslambda sinphi &
-sinlambda costheta sinphi + coslambda cosphi &
-sinlambda sintheta \
sintheta cosphi &
-sintheta sinphi &
costheta
endpmatrix
endalign
This results in a single $3 times 3$ matrix.
If you have two of those transformations $U_1$ and $U_2$ then the composition is given by the matrix product
$$
U_2 U_1
$$
One would have to calculate the resulting matrices and then check if it is possible to easily read the angles from the result.
I already did the matrix transformation, but have no clue how to read the angles from the resulting matrix
â 4rzael
9 hours ago
You can calculate $U_2 U_1$ for your given parameter sets and then try to fit that to a new matrix $U$. E.g. the last element is $cos theta$ and you should get the resulting $theta=arccos U_33$. Then use e.g. $U_23$ and $U_32$ to recover the resulting $lambda$ and $phi$. It is possible that there are several solutions.
â mvw
9 hours ago
Note that you have a sign issue. In the rotation matrix around $y$ axis the $+sin$ is in the upper corner.
â Andrei
9 hours ago
@Andrei: You could be right, if I compare to this. No I idea what 4rzael uses. I would suggest to check the calculation anyways. :-)
â mvw
9 hours ago
@mvw That's exactly what I was looking at :)
â Andrei
9 hours ago
add a comment |Â
up vote
2
down vote
up vote
2
down vote
You can express rotations as matrices. Their combination is found by matrix multiplication.
In your case
it performs a rotation on $z$ of $phi$ radians, then a rotation over
$y$ of $theta$ radians, and finally a last rotation, again on $z$, of
$lambda$ radians.
we have:
beginalign
U
&= R_z(lambda) , R_y(theta) , R_z(phi) \
&=
beginpmatrix
coslambda & -sinlambda & 0 \
sinlambda & coslambda & 0 \
0 & 0 & 1
endpmatrix
beginpmatrix
costheta & 0 & -sintheta \
0 & 1 & 0 \
sintheta & 0 & costheta
endpmatrix
beginpmatrix
cosphi & -sinphi & 0 \
sinphi & cosphi & 0 \
0 & 0 & 1
endpmatrix
\
&=
beginpmatrix
coslambda & -sinlambda & 0 \
sinlambda & coslambda & 0 \
0 & 0 & 1
endpmatrix
beginpmatrix
costheta cosphi & -costheta sinphi & -sintheta \
sinphi & cosphi & 0 \
sintheta cosphi & -sintheta sinphi & costheta
endpmatrix
\
&=
beginpmatrix
coslambda costheta cosphi - sinlambda sinphi &
-coslambda costheta sinphi - sinlambda cosphi &
-coslambda sintheta \
sinlambda costheta cosphi + coslambda sinphi &
-sinlambda costheta sinphi + coslambda cosphi &
-sinlambda sintheta \
sintheta cosphi &
-sintheta sinphi &
costheta
endpmatrix
endalign
This results in a single $3 times 3$ matrix.
If you have two of those transformations $U_1$ and $U_2$ then the composition is given by the matrix product
$$
U_2 U_1
$$
One would have to calculate the resulting matrices and then check if it is possible to easily read the angles from the result.
You can express rotations as matrices. Their combination is found by matrix multiplication.
In your case
it performs a rotation on $z$ of $phi$ radians, then a rotation over
$y$ of $theta$ radians, and finally a last rotation, again on $z$, of
$lambda$ radians.
we have:
beginalign
U
&= R_z(lambda) , R_y(theta) , R_z(phi) \
&=
beginpmatrix
coslambda & -sinlambda & 0 \
sinlambda & coslambda & 0 \
0 & 0 & 1
endpmatrix
beginpmatrix
costheta & 0 & -sintheta \
0 & 1 & 0 \
sintheta & 0 & costheta
endpmatrix
beginpmatrix
cosphi & -sinphi & 0 \
sinphi & cosphi & 0 \
0 & 0 & 1
endpmatrix
\
&=
beginpmatrix
coslambda & -sinlambda & 0 \
sinlambda & coslambda & 0 \
0 & 0 & 1
endpmatrix
beginpmatrix
costheta cosphi & -costheta sinphi & -sintheta \
sinphi & cosphi & 0 \
sintheta cosphi & -sintheta sinphi & costheta
endpmatrix
\
&=
beginpmatrix
coslambda costheta cosphi - sinlambda sinphi &
-coslambda costheta sinphi - sinlambda cosphi &
-coslambda sintheta \
sinlambda costheta cosphi + coslambda sinphi &
-sinlambda costheta sinphi + coslambda cosphi &
-sinlambda sintheta \
sintheta cosphi &
-sintheta sinphi &
costheta
endpmatrix
endalign
This results in a single $3 times 3$ matrix.
If you have two of those transformations $U_1$ and $U_2$ then the composition is given by the matrix product
$$
U_2 U_1
$$
One would have to calculate the resulting matrices and then check if it is possible to easily read the angles from the result.
edited 10 hours ago
answered 11 hours ago
mvw
30.1k22150
30.1k22150
I already did the matrix transformation, but have no clue how to read the angles from the resulting matrix
â 4rzael
9 hours ago
You can calculate $U_2 U_1$ for your given parameter sets and then try to fit that to a new matrix $U$. E.g. the last element is $cos theta$ and you should get the resulting $theta=arccos U_33$. Then use e.g. $U_23$ and $U_32$ to recover the resulting $lambda$ and $phi$. It is possible that there are several solutions.
â mvw
9 hours ago
Note that you have a sign issue. In the rotation matrix around $y$ axis the $+sin$ is in the upper corner.
â Andrei
9 hours ago
@Andrei: You could be right, if I compare to this. No I idea what 4rzael uses. I would suggest to check the calculation anyways. :-)
â mvw
9 hours ago
@mvw That's exactly what I was looking at :)
â Andrei
9 hours ago
add a comment |Â
I already did the matrix transformation, but have no clue how to read the angles from the resulting matrix
â 4rzael
9 hours ago
You can calculate $U_2 U_1$ for your given parameter sets and then try to fit that to a new matrix $U$. E.g. the last element is $cos theta$ and you should get the resulting $theta=arccos U_33$. Then use e.g. $U_23$ and $U_32$ to recover the resulting $lambda$ and $phi$. It is possible that there are several solutions.
â mvw
9 hours ago
Note that you have a sign issue. In the rotation matrix around $y$ axis the $+sin$ is in the upper corner.
â Andrei
9 hours ago
@Andrei: You could be right, if I compare to this. No I idea what 4rzael uses. I would suggest to check the calculation anyways. :-)
â mvw
9 hours ago
@mvw That's exactly what I was looking at :)
â Andrei
9 hours ago
I already did the matrix transformation, but have no clue how to read the angles from the resulting matrix
â 4rzael
9 hours ago
I already did the matrix transformation, but have no clue how to read the angles from the resulting matrix
â 4rzael
9 hours ago
You can calculate $U_2 U_1$ for your given parameter sets and then try to fit that to a new matrix $U$. E.g. the last element is $cos theta$ and you should get the resulting $theta=arccos U_33$. Then use e.g. $U_23$ and $U_32$ to recover the resulting $lambda$ and $phi$. It is possible that there are several solutions.
â mvw
9 hours ago
You can calculate $U_2 U_1$ for your given parameter sets and then try to fit that to a new matrix $U$. E.g. the last element is $cos theta$ and you should get the resulting $theta=arccos U_33$. Then use e.g. $U_23$ and $U_32$ to recover the resulting $lambda$ and $phi$. It is possible that there are several solutions.
â mvw
9 hours ago
Note that you have a sign issue. In the rotation matrix around $y$ axis the $+sin$ is in the upper corner.
â Andrei
9 hours ago
Note that you have a sign issue. In the rotation matrix around $y$ axis the $+sin$ is in the upper corner.
â Andrei
9 hours ago
@Andrei: You could be right, if I compare to this. No I idea what 4rzael uses. I would suggest to check the calculation anyways. :-)
â mvw
9 hours ago
@Andrei: You could be right, if I compare to this. No I idea what 4rzael uses. I would suggest to check the calculation anyways. :-)
â mvw
9 hours ago
@mvw That's exactly what I was looking at :)
â Andrei
9 hours ago
@mvw That's exactly what I was looking at :)
â Andrei
9 hours ago
add a comment |Â
up vote
0
down vote
A lot of details about this subject are in the Wikipedia article Euler angles. As an alternative, you can use
quaternions as in the Wikipedia article Quaternion and spatial rotations and just multiply two or more quaternions.
add a comment |Â
up vote
0
down vote
A lot of details about this subject are in the Wikipedia article Euler angles. As an alternative, you can use
quaternions as in the Wikipedia article Quaternion and spatial rotations and just multiply two or more quaternions.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
A lot of details about this subject are in the Wikipedia article Euler angles. As an alternative, you can use
quaternions as in the Wikipedia article Quaternion and spatial rotations and just multiply two or more quaternions.
A lot of details about this subject are in the Wikipedia article Euler angles. As an alternative, you can use
quaternions as in the Wikipedia article Quaternion and spatial rotations and just multiply two or more quaternions.
answered 10 hours ago
Somos
10.7k1830
10.7k1830
add a comment |Â
add a comment |Â
up vote
0
down vote
Start from the rotation matrix in terms of Euler angles. $$R(phi,theta,lambda)=beginpmatrixR_11& R_12 &R_13\R_21& R_22 &R_23\R_31& R_32 &R_33endpmatrix$$
First calculate the inner most angle. If $R_31$ and $R_32$ are both zero, use $lambda=0$. Otherwise $$tanlambda=fracR_32-R_31$$ You can use the $arctan2$ function
$$lambda=arctan2 (R_32,-R_31)$$
Now calculate $$R'(phi,theta)=R(phi,theta,lambda)R^-1_z(lambda)=R(phi,theta,lambda)R_z(-lambda)$$
If you do the calculations right, you get $phi=arctan2(-R'_12,R'_22)$
and $theta=arctan2(-R'_31,R'_33)$
add a comment |Â
up vote
0
down vote
Start from the rotation matrix in terms of Euler angles. $$R(phi,theta,lambda)=beginpmatrixR_11& R_12 &R_13\R_21& R_22 &R_23\R_31& R_32 &R_33endpmatrix$$
First calculate the inner most angle. If $R_31$ and $R_32$ are both zero, use $lambda=0$. Otherwise $$tanlambda=fracR_32-R_31$$ You can use the $arctan2$ function
$$lambda=arctan2 (R_32,-R_31)$$
Now calculate $$R'(phi,theta)=R(phi,theta,lambda)R^-1_z(lambda)=R(phi,theta,lambda)R_z(-lambda)$$
If you do the calculations right, you get $phi=arctan2(-R'_12,R'_22)$
and $theta=arctan2(-R'_31,R'_33)$
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Start from the rotation matrix in terms of Euler angles. $$R(phi,theta,lambda)=beginpmatrixR_11& R_12 &R_13\R_21& R_22 &R_23\R_31& R_32 &R_33endpmatrix$$
First calculate the inner most angle. If $R_31$ and $R_32$ are both zero, use $lambda=0$. Otherwise $$tanlambda=fracR_32-R_31$$ You can use the $arctan2$ function
$$lambda=arctan2 (R_32,-R_31)$$
Now calculate $$R'(phi,theta)=R(phi,theta,lambda)R^-1_z(lambda)=R(phi,theta,lambda)R_z(-lambda)$$
If you do the calculations right, you get $phi=arctan2(-R'_12,R'_22)$
and $theta=arctan2(-R'_31,R'_33)$
Start from the rotation matrix in terms of Euler angles. $$R(phi,theta,lambda)=beginpmatrixR_11& R_12 &R_13\R_21& R_22 &R_23\R_31& R_32 &R_33endpmatrix$$
First calculate the inner most angle. If $R_31$ and $R_32$ are both zero, use $lambda=0$. Otherwise $$tanlambda=fracR_32-R_31$$ You can use the $arctan2$ function
$$lambda=arctan2 (R_32,-R_31)$$
Now calculate $$R'(phi,theta)=R(phi,theta,lambda)R^-1_z(lambda)=R(phi,theta,lambda)R_z(-lambda)$$
If you do the calculations right, you get $phi=arctan2(-R'_12,R'_22)$
and $theta=arctan2(-R'_31,R'_33)$
answered 9 hours ago
Andrei
7,3302822
7,3302822
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%2f2873176%2fcombining-two-rotations%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
By $R_z(phi)$ do you mean $R_x(phi)$?
â Arnaud Mortier
11 hours ago
Yes, you can find a solution, but that might not be unique.
â Andrei
11 hours ago
Arnaud Mortier: No, it really is $R_z(phi)$. I am taking that $U$ function from a paper, and have to stick with it.
â 4rzael
9 hours ago
And @Andrei: The non-uniqueness of the result is not a problem (a deterministic solution to the problem would be preferable, in this case, though)
â 4rzael
9 hours ago