QTEULER Name
QTEULER
Author
Craig B. Markwardt, NASA/GSFC Code 662, Greenbelt, MD 20770
craigm@lheamail.gsfc.nasa.gov
UPDATED VERSIONs can be found on my WEB PAGE:
http://cow.physics.wisc.edu/~craigm/idl/idl.html
Purpose
Compose a series of euler-type rotations into a single quaternion
Major Topics
Geometry
Calling Sequence
Q = QTEULER(AXES, ANG0, ANG1, ... )
Description
The function QTEULER composes a series of Euler-type rotations into
a single set of quaternion representations.
The user specifies a set of axes, and the angles to rotation about
those axes, and QTEULER constructs the corresponding quaternion.
There must be a one-to-one correspondence between the elements of
AXES and the number of rotations. AXES specifies the rotation axes
as an string, which must be one of 'X', 'Y', or 'Z'. Other axes
are invalid. For example, the following call:
QTEULER(['X','Z'], THETA, PHI)
will rotate first about the *Z* axis by the angle PHI, and then
around the *resulting X* axis by angle THETA.
Several things are worth noting here. First, rotations are applied
first from the right, not the left. This conforms to the usual
matrix notation for applying rotations to a vector on the right
hand side. For example, in matrix notation,
XNEW = A3 A2 A1 XOLD
applies first A1, then A2 and finally A3 to the XOLD vector,
resulting in the new vector XNEW. The same semantics apply here.
A second thing to bear in mind is that the axes themselves change
during the rotations. Thus, the coordinates specified in AXES
should be considered attached to the "body" and not the inertial
frame. Inputs
AXES - a string array, specifies the rotation axes. Rotations are
applied last element first. Each element of AXES must be
one of 'X', 'Y' or 'Z'.
ANG0, ..., ANGi - the successive rotation angles. Angle ANGi
corresponds to axis AXES(i).
If ANGi is a scalar, then it will be promoted to a vector
the same size as the other rotation angles being performed.
Otherwise, if the angles ANGi are vectors, then they must
all be of the same size.
Returns
The resulting quaternion (or, if ANGi are vectors, array of
quaternions), which represent the requested rotations.
Keyword Parameters
NONE
Example
;; Precession Nutation
qtot = qteuler(['z','y','z', 'x','z','x' ], $
-zeta, +theta, -z, +eps0, -dpsi, -eps)
Applies a series of rotations to correct for earth nutation and
precession. The order of rotations on a vector would be
X-Z-X-Z-Y-Z (i.e., the reverse order printed).
See Also
QTANG, QTAXIS, QTCOMPOSE, QTERP, QTEXP, QTFIND, QTINV, QTLOG,
QTMAT, QTMULT, QTPOW, QTVROT
Modification History
Written, 27 Jan 2002, CM
More error checking, 03 Mar 2002, CM