rotation - Matlab angle2dcm different definition -
i using matlab function angle2dcm gives me different results expected. digging code (angle2dcm.m) found definition of forming rotation matrix different standard one.
for example, rotation rxryrz (i.e. 'xyz' order) defined as:
% [ cy*cz, sz*cx+sy*sx*cz, sz*sx-sy*cx*cz] % [ -cy*sz, cz*cx-sy*sx*sz, cz*sx+sy*cx*sz] % [ sy, -cy*sx, cy*cx]
while should (please refer link): http://inside.mines.edu/fs_home/gmurray/arbitraryaxisrotation/
is different definition of direction cosine matrix , rotation matrix? thanks!
it's issue notation conventions, since 2 cases (matlab versus link posted) refer opposite orders of rotation. if want use matlab function , continue use convention link posted, possible workaround can call function 'zyx' , invert signs of angles, i.e.
dcm = angle2dcm( -r1, -r2, -r3,'xyz'); *edited*
which uses following rotation matrix (see matlab documentation)
[ cy*cz, sz*cx+sy*sx*cz, sz*sx-sy*cx*cz] [ -cy*sz, cz*cx-sy*sx*sz, cz*sx+sy*cx*sz] [ sy, -cy*sx, cy*cx]
if confusing wrap in helper function sign , order inversion you, like
function dcm = angle2dcm_mines( r1, r2, r3); dcm = angle2dcm( -r1, -r2, -r3,'xyz');
there other ways work around should work.
Comments
Post a Comment