From: jace@robots.ox.ac.uk
Subject: Re: TECH: WorldToolkit quaternions
Date: Mon, 16 Oct 1995 08:16:33 -0700


From: jace@robots.ox.ac.uk

It is very easy to get from quaternions to a 3 X 3 rotation matrix,
from which you can easily go to Euler angles.  The 3 X 3 rotation
matrix is given by:

q0^2 + q1^2 + q2^2 + q3^2       2(q1q2 - q0q3)        2(q1q3 + q0q2)
2(q1q2 + q0q3)            q0^2 - q1^2 + q2^2 - q3^2   2(q2q3 - q0q1)
2(q1q3 - q0q2)            2(q_2q_3 + q_0q_1)        q0^2 - q1^2 - q2^2 + q3^2

where the quaternion is (q0,q1,q2,q3).

I also have the decompostion from a quaternion directly into pan,
elevation, and cyclotorsion angles for a gun turret mount camera, if
you want them.   I use this conversion in my telepresence application
which is viewable on http://www.robots.ox.ac.uk:5000/~jace/
_____________
Jason Heuring                           jace@robots.ox.ac.uk
Robotics Research Group                 phone: +44 1865 273168
Oxford University                       fax:   +44 1865 273908
Oxford  OX1 3PJ


