[ODE] need to understand this
pia dalusong
ps_yumemi at yahoo.com
Sat Nov 9 02:27:02 2002
hello,
after a lot of digging, i saw this
void dRFromEulerAngles (dMatrix3 R, dReal phi, dReal
theta, dReal psi)
{
dReal sphi,cphi,stheta,ctheta,spsi,cpsi;
dAASSERT (R);
sphi = dSin(phi);
cphi = dCos(phi);
stheta = dSin(theta);
ctheta = dCos(theta);
spsi = dSin(psi);
cpsi = dCos(psi);
_R(0,0) = cpsi*ctheta;
_R(0,1) = spsi*ctheta;
_R(0,2) =-stheta;
_R(1,0) = cpsi*stheta*sphi - spsi*cphi;
_R(1,1) = spsi*stheta*sphi + cpsi*cphi;
_R(1,2) = ctheta*sphi;
_R(2,0) = cpsi*stheta*cphi + spsi*sphi;
_R(2,1) = spsi*stheta*cphi - cpsi*sphi;
_R(2,2) = ctheta*cphi;
}
i'm a little confused as to how you put values into a
dMatrix and how do you call it?
if i have a variable
const dReal *R
and
dMatrix3 M
is R[0]=m[0,0] ?
i'm sorry but i don't understand what happens when you
write _R(2,1)
is it an 2d array matrix[3][3] or a 1d matrix[12]?
thanks
__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2