comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: IDLgrModel, rotation angles
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: IDLgrModel, rotation angles [message #38121] Mon, 23 February 2004 11:36 Go to next message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
"lyubo" wrote...

> I have a transformation matrix and I must find the amount of rotation
> in degrees. How can I do that? Any help would be appreciated.

If James answer doesn't satisfy you, take a look at the Matrix and
Quaternion FAQ, question 37. A copy is available here:

http://skal.planet-d.net/demo/matrixfaq.htm#Q37

-Rick
Re: IDLgrModel, rotation angles [message #38122 is a reply to message #38121] Mon, 23 February 2004 11:49 Go to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
lyubo wrote:
>
> Hello,
>
> I have a transformation matrix and I must find the amount of rotation
> in degrees. How can I do that? Any help would be appreciated.
>

Forget previous reply; I was being too complicated. A much simpler
expression for the rotation angle in degrees is:

!RADEG*ACOS(0.5D*(TRACE(rot)-1.0D))

Warning: if the rotation angle is small, the trace might exceed 3.0 due
to round-off error; if it's close to 180 degrees, the trace might be
less than -3.0, for the same reason. If you're sure that roundoff is the
only possible cause of such a problem, the following modification avoids
that problem:

!RADEG*ACOS((0.5D*(TRACE(rot)-1.0D)) <1.0 >(-1.0))
Re: IDLgrModel, rotation angles [message #38123 is a reply to message #38121] Mon, 23 February 2004 10:27 Go to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
lyubo wrote:
>
> Hello,
>
> I have a transformation matrix and I must find the amount of rotation
> in degrees. How can I do that? Any help would be appreciated.
>
> Thank you,
>
> Lyubo


The eigenvalues of a pure rotation matrix are

EXP(COMPLEX(0,-theta))
1.0
EXP(COMPLEX(0,theta))

where theta is the rotation angle in radians. Therefore,

!RADEG*MAX(IMAGINARY(ALOG(HQR(ELMHESS(rot)))))

Will give you back the rotation angle of rot in degrees.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Array string
Next Topic: Re: HDF frustrations

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:39:48 PDT 2025

Total time taken to generate the page: 0.00552 seconds