[Insight-users] Angles of rotation from transformation matrix

Ron Inbar ron@mediguide.co.il
Sun, 27 Apr 2003 11:24:10 +0200


Hi Mike,

Assuming you post-multiply your matrix by the vector to be transformed (i.e.
v' = Tv, rather than v' = vT), and assuming the order of transformation is T
= Rz Ry Rx (i.e., rotation by phi radians about the world's x-axis is
applied first, then rotation by theta radians about the world's y-axis, and
finally rotation by psi radians about the world's z-axis, or, alternatively,
rotation by psi radians about the object's z-axis, then by theta radians
about the object's y-axis, and finally by phi radians about the object's
x-axis), then T has the following form:

[cos(theta)*cos(psi), -cos(theta)*sin(psi), -sin(theta)]
[sin(phi)*sin(theta)*cos(psi)+cos(phi)*sin(psi),
-sin(phi)*sin(theta)*sin(psi)+cos(phi)*cos(psi), sin(phi)*cos(theta)]
[cos(phi)*sin(theta)*cos(psi)-sin(phi)*sin(psi),
-cos(phi)*sin(theta)*sin(psi)-sin(phi)*cos(psi), cos(phi)*cos(theta)]

Therefore you can use the following formulas to extract the angles:

Phi = atan2(T(2,3), T(3,3))
Theta = asin(-T(1,3))
Psi = atan2(-T(1,2), T(1,1))

(In MATLAB semantics)

Hope this helps,

Ron

> -----Original Message-----
> From: Mike Bristow [mailto:msbristo@ucalgary.ca]
> Sent: Friday, April 25, 2003 7:02 PM
> To: insight-users@public.kitware.com
> Subject: [Insight-users] Angles of rotation from transformation matrix
> 
> 
> Hi,
> 
> How can I calculate the angles of rotation about each axis from an
> Affine transformation matrix? There isn't any scale or shear in the
> matrix, only rotation.
> 
> Does anyone know the order of rotation used to get the rotation matrix
> (RxRyRz or RzRyRx)?
> 
> Mike Bristow
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users

This e-mail message has been sent by MediGuide
and is for the use of the intended recipients only.
The message may contain privileged or confidential information .
If you are not the intended recipient you are hereby notified that any use,
distribution or copying of this communication is strictly prohibited,
and you are requested to delete the e-mail and any attachments
and notify the sender immediately.