How to rotate an orientation (Euler angles)












0












$begingroup$


If I have an orientation defined by Euler angles and I want to simulate a rotation of the coordinate system about the origin (doesn't matter to me how the rotation is specified), how would I get the new Euler angles? I understand how to transform a point via a rotation matrix, but I'm not sure how to approach this in terms of Euler angles.



For example, I'm thinking of an airplane's orientation in terms of pitch, yaw, and roll, and say I want to simulate a random rotation of the airplane about its center.










share|cite|improve this question









$endgroup$












  • $begingroup$
    The rotation matrix is given here: en.wikipedia.org/wiki/Euler_angles#Rotation_matrix
    $endgroup$
    – Yves Daoust
    Mar 12 '15 at 15:50










  • $begingroup$
    How would I apply the rotation matrix to my original Euler angles?
    $endgroup$
    – rmp251
    Mar 12 '15 at 16:21










  • $begingroup$
    You just compute it from the Euler angles !
    $endgroup$
    – Yves Daoust
    Mar 12 '15 at 17:22










  • $begingroup$
    Thanks for the comment but you are misunderstanding my question. How do I apply (not compute) such a rotation transformation to an orientation (as specified via Euler angles) as opposed to points in 3-space?
    $endgroup$
    – rmp251
    Mar 12 '15 at 19:03










  • $begingroup$
    I guess that the only way is to multiply the rotation matrices and inverse the process to retrieve the Euler angles corresponding to the combined rotations (see my answer about this).
    $endgroup$
    – Yves Daoust
    Mar 12 '15 at 19:58
















0












$begingroup$


If I have an orientation defined by Euler angles and I want to simulate a rotation of the coordinate system about the origin (doesn't matter to me how the rotation is specified), how would I get the new Euler angles? I understand how to transform a point via a rotation matrix, but I'm not sure how to approach this in terms of Euler angles.



For example, I'm thinking of an airplane's orientation in terms of pitch, yaw, and roll, and say I want to simulate a random rotation of the airplane about its center.










share|cite|improve this question









$endgroup$












  • $begingroup$
    The rotation matrix is given here: en.wikipedia.org/wiki/Euler_angles#Rotation_matrix
    $endgroup$
    – Yves Daoust
    Mar 12 '15 at 15:50










  • $begingroup$
    How would I apply the rotation matrix to my original Euler angles?
    $endgroup$
    – rmp251
    Mar 12 '15 at 16:21










  • $begingroup$
    You just compute it from the Euler angles !
    $endgroup$
    – Yves Daoust
    Mar 12 '15 at 17:22










  • $begingroup$
    Thanks for the comment but you are misunderstanding my question. How do I apply (not compute) such a rotation transformation to an orientation (as specified via Euler angles) as opposed to points in 3-space?
    $endgroup$
    – rmp251
    Mar 12 '15 at 19:03










  • $begingroup$
    I guess that the only way is to multiply the rotation matrices and inverse the process to retrieve the Euler angles corresponding to the combined rotations (see my answer about this).
    $endgroup$
    – Yves Daoust
    Mar 12 '15 at 19:58














0












0








0





$begingroup$


If I have an orientation defined by Euler angles and I want to simulate a rotation of the coordinate system about the origin (doesn't matter to me how the rotation is specified), how would I get the new Euler angles? I understand how to transform a point via a rotation matrix, but I'm not sure how to approach this in terms of Euler angles.



For example, I'm thinking of an airplane's orientation in terms of pitch, yaw, and roll, and say I want to simulate a random rotation of the airplane about its center.










share|cite|improve this question









$endgroup$




If I have an orientation defined by Euler angles and I want to simulate a rotation of the coordinate system about the origin (doesn't matter to me how the rotation is specified), how would I get the new Euler angles? I understand how to transform a point via a rotation matrix, but I'm not sure how to approach this in terms of Euler angles.



For example, I'm thinking of an airplane's orientation in terms of pitch, yaw, and roll, and say I want to simulate a random rotation of the airplane about its center.







transformation coordinate-systems rotations orientation






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Mar 12 '15 at 15:19









rmp251rmp251

1253




1253












  • $begingroup$
    The rotation matrix is given here: en.wikipedia.org/wiki/Euler_angles#Rotation_matrix
    $endgroup$
    – Yves Daoust
    Mar 12 '15 at 15:50










  • $begingroup$
    How would I apply the rotation matrix to my original Euler angles?
    $endgroup$
    – rmp251
    Mar 12 '15 at 16:21










  • $begingroup$
    You just compute it from the Euler angles !
    $endgroup$
    – Yves Daoust
    Mar 12 '15 at 17:22










  • $begingroup$
    Thanks for the comment but you are misunderstanding my question. How do I apply (not compute) such a rotation transformation to an orientation (as specified via Euler angles) as opposed to points in 3-space?
    $endgroup$
    – rmp251
    Mar 12 '15 at 19:03










  • $begingroup$
    I guess that the only way is to multiply the rotation matrices and inverse the process to retrieve the Euler angles corresponding to the combined rotations (see my answer about this).
    $endgroup$
    – Yves Daoust
    Mar 12 '15 at 19:58


















  • $begingroup$
    The rotation matrix is given here: en.wikipedia.org/wiki/Euler_angles#Rotation_matrix
    $endgroup$
    – Yves Daoust
    Mar 12 '15 at 15:50










  • $begingroup$
    How would I apply the rotation matrix to my original Euler angles?
    $endgroup$
    – rmp251
    Mar 12 '15 at 16:21










  • $begingroup$
    You just compute it from the Euler angles !
    $endgroup$
    – Yves Daoust
    Mar 12 '15 at 17:22










  • $begingroup$
    Thanks for the comment but you are misunderstanding my question. How do I apply (not compute) such a rotation transformation to an orientation (as specified via Euler angles) as opposed to points in 3-space?
    $endgroup$
    – rmp251
    Mar 12 '15 at 19:03










  • $begingroup$
    I guess that the only way is to multiply the rotation matrices and inverse the process to retrieve the Euler angles corresponding to the combined rotations (see my answer about this).
    $endgroup$
    – Yves Daoust
    Mar 12 '15 at 19:58
















$begingroup$
The rotation matrix is given here: en.wikipedia.org/wiki/Euler_angles#Rotation_matrix
$endgroup$
– Yves Daoust
Mar 12 '15 at 15:50




$begingroup$
The rotation matrix is given here: en.wikipedia.org/wiki/Euler_angles#Rotation_matrix
$endgroup$
– Yves Daoust
Mar 12 '15 at 15:50












$begingroup$
How would I apply the rotation matrix to my original Euler angles?
$endgroup$
– rmp251
Mar 12 '15 at 16:21




$begingroup$
How would I apply the rotation matrix to my original Euler angles?
$endgroup$
– rmp251
Mar 12 '15 at 16:21












$begingroup$
You just compute it from the Euler angles !
$endgroup$
– Yves Daoust
Mar 12 '15 at 17:22




$begingroup$
You just compute it from the Euler angles !
$endgroup$
– Yves Daoust
Mar 12 '15 at 17:22












$begingroup$
Thanks for the comment but you are misunderstanding my question. How do I apply (not compute) such a rotation transformation to an orientation (as specified via Euler angles) as opposed to points in 3-space?
$endgroup$
– rmp251
Mar 12 '15 at 19:03




$begingroup$
Thanks for the comment but you are misunderstanding my question. How do I apply (not compute) such a rotation transformation to an orientation (as specified via Euler angles) as opposed to points in 3-space?
$endgroup$
– rmp251
Mar 12 '15 at 19:03












$begingroup$
I guess that the only way is to multiply the rotation matrices and inverse the process to retrieve the Euler angles corresponding to the combined rotations (see my answer about this).
$endgroup$
– Yves Daoust
Mar 12 '15 at 19:58




$begingroup$
I guess that the only way is to multiply the rotation matrices and inverse the process to retrieve the Euler angles corresponding to the combined rotations (see my answer about this).
$endgroup$
– Yves Daoust
Mar 12 '15 at 19:58










1 Answer
1






active

oldest

votes


















0












$begingroup$

Let us assume that the rotation is known by a $3times3$ matrix, and let us focus on the one specified as $X_1Z_2X_3$ in the Wikipedia article.



You get $alpha$ from $tanalpha=dfrac{s_1s_2}{c_1s_2}$.



You get $beta$ from $tanbeta=dfrac{sqrt{(s_2c_3)^2+(s_2s_3)^2}}{c_2}$.



You get $gamma$ from $tangamma=dfrac{s_3s_2}{c_3s_2}$.



As expected, $beta=0$ creates an indeterminacy, but this case is easy to deal with (it reduces to a single rotation $alpha+gamma$).



You can probably improve the accuracy by a least-squares fitting of the matrix derived from the angles to the given matrix, but this will require the Levenberg-Marquardt algorithm as this is a non-linear problem.



I guess that you can also address the computation of the angles by using three well-chosen Givens rotations that will transform the input matrix to a unit one (backwards, $X_1Z_2X_3to X_1Z_2to X_1to I$, corresponding to angles $(alpha,beta,gamma)to(alpha,beta,0)to(alpha,0,0)to(0,0,0)$).






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Thanks for your answer. I was hoping for something simpler but I'll have to digest it a little bit to see if it's what I was looking for.
    $endgroup$
    – rmp251
    Mar 13 '15 at 13:09










  • $begingroup$
    The other option is to modify the angles randomly.
    $endgroup$
    – Yves Daoust
    Mar 13 '15 at 14:05











Your Answer





StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1186923%2fhow-to-rotate-an-orientation-euler-angles%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0












$begingroup$

Let us assume that the rotation is known by a $3times3$ matrix, and let us focus on the one specified as $X_1Z_2X_3$ in the Wikipedia article.



You get $alpha$ from $tanalpha=dfrac{s_1s_2}{c_1s_2}$.



You get $beta$ from $tanbeta=dfrac{sqrt{(s_2c_3)^2+(s_2s_3)^2}}{c_2}$.



You get $gamma$ from $tangamma=dfrac{s_3s_2}{c_3s_2}$.



As expected, $beta=0$ creates an indeterminacy, but this case is easy to deal with (it reduces to a single rotation $alpha+gamma$).



You can probably improve the accuracy by a least-squares fitting of the matrix derived from the angles to the given matrix, but this will require the Levenberg-Marquardt algorithm as this is a non-linear problem.



I guess that you can also address the computation of the angles by using three well-chosen Givens rotations that will transform the input matrix to a unit one (backwards, $X_1Z_2X_3to X_1Z_2to X_1to I$, corresponding to angles $(alpha,beta,gamma)to(alpha,beta,0)to(alpha,0,0)to(0,0,0)$).






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Thanks for your answer. I was hoping for something simpler but I'll have to digest it a little bit to see if it's what I was looking for.
    $endgroup$
    – rmp251
    Mar 13 '15 at 13:09










  • $begingroup$
    The other option is to modify the angles randomly.
    $endgroup$
    – Yves Daoust
    Mar 13 '15 at 14:05
















0












$begingroup$

Let us assume that the rotation is known by a $3times3$ matrix, and let us focus on the one specified as $X_1Z_2X_3$ in the Wikipedia article.



You get $alpha$ from $tanalpha=dfrac{s_1s_2}{c_1s_2}$.



You get $beta$ from $tanbeta=dfrac{sqrt{(s_2c_3)^2+(s_2s_3)^2}}{c_2}$.



You get $gamma$ from $tangamma=dfrac{s_3s_2}{c_3s_2}$.



As expected, $beta=0$ creates an indeterminacy, but this case is easy to deal with (it reduces to a single rotation $alpha+gamma$).



You can probably improve the accuracy by a least-squares fitting of the matrix derived from the angles to the given matrix, but this will require the Levenberg-Marquardt algorithm as this is a non-linear problem.



I guess that you can also address the computation of the angles by using three well-chosen Givens rotations that will transform the input matrix to a unit one (backwards, $X_1Z_2X_3to X_1Z_2to X_1to I$, corresponding to angles $(alpha,beta,gamma)to(alpha,beta,0)to(alpha,0,0)to(0,0,0)$).






share|cite|improve this answer











$endgroup$













  • $begingroup$
    Thanks for your answer. I was hoping for something simpler but I'll have to digest it a little bit to see if it's what I was looking for.
    $endgroup$
    – rmp251
    Mar 13 '15 at 13:09










  • $begingroup$
    The other option is to modify the angles randomly.
    $endgroup$
    – Yves Daoust
    Mar 13 '15 at 14:05














0












0








0





$begingroup$

Let us assume that the rotation is known by a $3times3$ matrix, and let us focus on the one specified as $X_1Z_2X_3$ in the Wikipedia article.



You get $alpha$ from $tanalpha=dfrac{s_1s_2}{c_1s_2}$.



You get $beta$ from $tanbeta=dfrac{sqrt{(s_2c_3)^2+(s_2s_3)^2}}{c_2}$.



You get $gamma$ from $tangamma=dfrac{s_3s_2}{c_3s_2}$.



As expected, $beta=0$ creates an indeterminacy, but this case is easy to deal with (it reduces to a single rotation $alpha+gamma$).



You can probably improve the accuracy by a least-squares fitting of the matrix derived from the angles to the given matrix, but this will require the Levenberg-Marquardt algorithm as this is a non-linear problem.



I guess that you can also address the computation of the angles by using three well-chosen Givens rotations that will transform the input matrix to a unit one (backwards, $X_1Z_2X_3to X_1Z_2to X_1to I$, corresponding to angles $(alpha,beta,gamma)to(alpha,beta,0)to(alpha,0,0)to(0,0,0)$).






share|cite|improve this answer











$endgroup$



Let us assume that the rotation is known by a $3times3$ matrix, and let us focus on the one specified as $X_1Z_2X_3$ in the Wikipedia article.



You get $alpha$ from $tanalpha=dfrac{s_1s_2}{c_1s_2}$.



You get $beta$ from $tanbeta=dfrac{sqrt{(s_2c_3)^2+(s_2s_3)^2}}{c_2}$.



You get $gamma$ from $tangamma=dfrac{s_3s_2}{c_3s_2}$.



As expected, $beta=0$ creates an indeterminacy, but this case is easy to deal with (it reduces to a single rotation $alpha+gamma$).



You can probably improve the accuracy by a least-squares fitting of the matrix derived from the angles to the given matrix, but this will require the Levenberg-Marquardt algorithm as this is a non-linear problem.



I guess that you can also address the computation of the angles by using three well-chosen Givens rotations that will transform the input matrix to a unit one (backwards, $X_1Z_2X_3to X_1Z_2to X_1to I$, corresponding to angles $(alpha,beta,gamma)to(alpha,beta,0)to(alpha,0,0)to(0,0,0)$).







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited Mar 12 '15 at 19:59

























answered Mar 12 '15 at 15:35









Yves DaoustYves Daoust

131k676229




131k676229












  • $begingroup$
    Thanks for your answer. I was hoping for something simpler but I'll have to digest it a little bit to see if it's what I was looking for.
    $endgroup$
    – rmp251
    Mar 13 '15 at 13:09










  • $begingroup$
    The other option is to modify the angles randomly.
    $endgroup$
    – Yves Daoust
    Mar 13 '15 at 14:05


















  • $begingroup$
    Thanks for your answer. I was hoping for something simpler but I'll have to digest it a little bit to see if it's what I was looking for.
    $endgroup$
    – rmp251
    Mar 13 '15 at 13:09










  • $begingroup$
    The other option is to modify the angles randomly.
    $endgroup$
    – Yves Daoust
    Mar 13 '15 at 14:05
















$begingroup$
Thanks for your answer. I was hoping for something simpler but I'll have to digest it a little bit to see if it's what I was looking for.
$endgroup$
– rmp251
Mar 13 '15 at 13:09




$begingroup$
Thanks for your answer. I was hoping for something simpler but I'll have to digest it a little bit to see if it's what I was looking for.
$endgroup$
– rmp251
Mar 13 '15 at 13:09












$begingroup$
The other option is to modify the angles randomly.
$endgroup$
– Yves Daoust
Mar 13 '15 at 14:05




$begingroup$
The other option is to modify the angles randomly.
$endgroup$
– Yves Daoust
Mar 13 '15 at 14:05


















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematics Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f1186923%2fhow-to-rotate-an-orientation-euler-angles%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

MongoDB - Not Authorized To Execute Command

in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

How to fix TextFormField cause rebuild widget in Flutter