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.

$\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$

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

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

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

You get $\gamma$ from $\tan\gamma=\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_3\to X_1Z_2\to X_1\to I$, corresponding to angles $(\alpha,\beta,\gamma)\to(\alpha,\beta,0)\to(\alpha,0,0)\to(0,0,0)$).

$\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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.