void rotmat_c ( ConstSpiceDouble m1,
SpiceDouble mout )
rotmat_c applies a rotation of angle radians about axis iaxis to a
matrix. This rotation is thought of as rotating the coordinate
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
m1 I Matrix to be rotated.
angle I Angle of rotation (radians).
iaxis I Axis of rotation (X=1, Y=2, Z=3).
mout O Resulting rotated matrix.
m1 This is a matrix to which a rotation is to be applied.
In matrix algebra, the components of the matrix are
relative to one particular coordinate system. Applying
rotmat_c changes the components of m1 so that they are
relative to a rotated coordinate system.
angle The angle in radians through which the original
coordinate system is to be rotated.
iaxis An index for the axis of the original coordinate system
about which the rotation by angle is to be performed.
iaxis = 1,2 or 3 designates the x-, y- or z-axis,
mout The matrix resulting from the application of the
specified rotation to the input matrix m1. If
denotes the rotation matrix by angle radians about iaxis,
(see the Rotations Required Reading document) then mout is
given by the following matrix equation:
mout = [angle] * m1
mout can overwrite m1.
1) If the axis index is not in the range 1 to 3 it will be
treated the same as that integer 1, 2, or 3 that is congruent
to it mod 3.
Suppose that to rotate the a set of inertial axes to body fixed
axes, one must first roll the coordinate axes about the x-axis by
angle r to get x', y', z'. From this one must pitch about the
y' axis by angle o to get x'', y'', z''. And finally yaw the
x'', y'', z'' about the z'' axis by angle y to obtain the
transformation to bodyfixed coordinates. If id is the identity
matrix, then the following code fragment generates the
transformation from interitial to body fixed.
rotmat_c ( id, r, 1, m1 );
rotmat_c ( m1, p, 2, m2 );
rotmat_c ( m2, y, 3, tibf );
N.J. Bachman (JPL)
W.M. Owen (JPL)
W.L. Taber (JPL)
-CSPICE Version 1.1.0, 22-OCT-1998 (NJB)
Made input matrix const.
-CSPICE Version 1.0.0, 08-FEB-1998 (NJB)
Based on SPICELIB Version 1.0.1, 10-MAR-1992 (WLT)
rotate a matrix