Google Answers Logo
View Question
 
Q: Direction Cosines to Euler XYZ ( No Answer,   4 Comments )
Question  
Subject: Direction Cosines to Euler XYZ
Category: Science > Math
Asked by: mikefazz-ga
List Price: $5.00
Posted: 29 Dec 2004 12:41 PST
Expires: 17 Jan 2005 16:24 PST
Question ID: 448862
I need the equations to go from a Direction Cosine Matrix to the three
Euler Angles using XYZ (XY'Z'') order.  The result should have atan2
in it and I also want the conditions for when an angle = 90 or 180.  I
have been looking for quite some time and have not found these.  I did
find the following:

R(x) = atan(DCM(2,3)/DCM(3,3)
R(y) = atan(-DCM(1,3))
R(z) = atan(DCM(1,2)/DCM(1,1))

But this gave me incorrect results (all angles were negative and R(y)
was incorrect) when I tried a DCM matrix I had made.

This should be pretty simple

Thanks
Answer  
There is no answer at this time.

Comments  
Subject: Re: Direction Cosines to Euler XYZ
From: dietlein-ga on 03 Jan 2005 10:20 PST
 
I assume this is what you found:  

href="http://www.mathworks.com/access/helpdesk/help/toolbox/aeroblks/directioncosinematrixtoeulerangles.html

R(y) should be asin(-DCM(1,3)).

The other two being negative depends on your reference coordinate
system.  There are other methods using atan2, if you prefer, which can
sort out that sign error by specifying the quadrant you're looking in.
Subject: Re: Direction Cosines to Euler XYZ
From: mikefazz-ga on 06 Jan 2005 23:51 PST
 
Thanks for the correction.  I would like the version that has atan2,
this is really what I was looking for but unable to find.

Mike
Subject: Re: Direction Cosines to Euler XYZ
From: augasm-ga on 09 Jan 2005 19:47 PST
 
For atan2 you need the independently-determined cosine and sin for two
of the euler angles. I use alpha, beta, gamma for euler angles --
alpha is rotation of "old" xy plane, beta is rotation of subsequent xz
axis, and gamma is rotation of the resulting xy plane into the "new"
position. If all coordinates are specified in the "new" basis set and
all vectors are normalized to 1  (e.g. passively rotating axes from
some non-diagonal "old" basis set into the "new" basis (1,0,0),
(0,1,0), and (0,0,1) ), the angles can be determined as follows (where
the ".", or period symbol means dot product):

beta = acos( oldz . newz )
alpha = acos( oldx . newz / sin(beta) ) = asin( oldy . newz / sin(beta) )
gamma = acos ( -oldz . newx / sin(beta) ) = asin( oldz . newy / (sin(beta) ),

with the important caveat that there is no meaningful alpha rotation
to be made if the z axis doesn't need to be rotated -- i.e. if beta =
0, alpha (and gamma) are undefined -- in this case only calculate
gamma = acos( oldy . newy ) = asin( oldy . newx ).

Law of Cosines says that, e.g. (oldz . newz) is the [3][3] element of
the Directions Cosine matrix, so you can easily now equate the other
dot-product expressions above with Direction Cosine Matrix elements --
the big difference, and I think the hurdle that caught you up is that
you must first calculate beta and include the sine of beta in the
denominator before taking inverse trig functions for alpha and gamma.
This term neatly cancels out when you take the ratio of sin/cos, but
leaves you with an ambiguity in atan(). Only the above allows you to
individually calculate (and obtain the sign of) sine and cosine of
alpha and gamma for use in atan2. Note that beta is restricted to
0<=beta<=pi, so cosine alone is sufficient.

This didn't come from any expert web research: I derived it.
Subject: Re: Direction Cosines to Euler XYZ
From: mikefazz-ga on 17 Jan 2005 16:24 PST
 
Thanks for all the help,

I was directed to a website with some helpful links:

http://www.isbweb.org/software/movanal.html

Mike

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy