# [ODE] RE: Angular velocity

Thu Apr 14 20:16:40 MST 2005

```Jon,

After I looked at the code for dRFromEulerAngles(), I took
[_R(0,0),  _R(0,1),  _R(0,2)] as the x axis of the body frame
coordinate system after rotation, [_R(1,0),  _R(1,1),  _R(1,2)]
as the y axis, and [_R(2,0),  _R(2,1),  _R(2,2)] as the z
axis. In this way, results look correct if I just negate all
the angular velocity input and output. If I'm to use
[_R(0,0),  _R(1,0),  _R(2,0)] as local x axi, etc., then I
should be able to use angular velocity as is. But then there
will be no way I can set the Euler angles properly, no matter
what permutation of phi, theta and psi and positive/negative
values. I'll have to change the ODE code to transpose the
resulting matrix of dRFromEulerAngles().

Thanks for taking your time to discuss the issue with me. At
least I know I'm not the only one who found the inconsistency.

Best Regards,

Yefei

> -----Original Message-----
> From: Jon Watte [mailto:hplus-ode at mindcontrol.org]
> Sent: Thursday, April 14, 2005 6:24 PM
> To: Yefei He
> Cc: ode at q12.org
> Subject: RE: Angular velocity
>
>
>
> > I interprete _R(m, n) as mth row and nth column, so my
> layout of the matrix
> >    _R(0,0)  _R(0,1)  _R(0,2)
> >    _R(1,0)  _R(1,1)  _R(1,2)
> >    _R(2,0)  _R(2,1)  _R(2,2)
>
> That still doesn't say anything, because you need to be
> whether you are using row vectors (on the left) or column vectors (on
> the right), AND you need to specify whether the layout is row
> major or
> column major.
>
> IIRC, OpenGL is row major, assuming row vectors on the left, which
> means the same thing as being column major, assuming column
> vectors on
> the right. I believe ODE actually flips one of these conventions --
> which of the two you choose to flip really doesn't matter, as
> the data
> comes out the same anyway.
>
> >     and so matrix multiplication is applied in the left to right
> > order. If
> > that's the case, then the function dRFromAxisAngle() is
> wrong, and angular
> > velocity is wrong too, because ODE has:
>
> I'm pretty sure angular velocity is right, so instead the matrix is
> not transposed, but instead the storage and/or vector convention is
> different from your expectation. Which means that likely the
> Euler angle
> functions are the wrong ones.
>
> Cheers,
>
> 			/ h+
>

```