# [ODE] Rotation matrix and Euler Angles - Easy

Holger Urbanek holger.urbanek at gmail.com
Wed Jul 5 00:33:48 MST 2006

```Well I did a quick check, and without looking at the math I found two
critics:
1) The sign is wrong. It alway gets the negated result.
2) If you are only trning around one axis, ODE-conversion to and back agin
with yours gets it right (well, except the sign; see 1). But if you turn
around multiple axis, results differ significantly.

And another question from me the the ODE-Experts here:
RPY (roll pitch yaw) and Euler are somehow different. And there exist many
(12 to be exact) Euler representations. What is ODE using when stating
'euler'?

On 7/5/06, Alex Green <alexg at acfr.usyd.edu.au> wrote:
>
> G'day, I used the following code, hope it helps!
> -alex
>
> //! Find Roll Pitch and Yaw
> // rotation Matrix then convert to Euler Angles
> dReal *R = (dReal *) dBodyGetRotation(body->bodyID);
> roll  = atan2(R[9], R[10]);     //phi
> pitch = asin(-R[8]);            //theta
> yaw   = atan2(R[4], R[0]);      //greek Y
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://q12.org/pipermail/ode/attachments/20060705/ba74d8a9/attachment.htm
```