Index Page rotmat_c

A B C D E F G H I J K L M N O P Q R S T U V W X

Procedure Abstract Required_Reading Keywords Brief_I/O Detailed_Input | Detailed_Output Parameters Exceptions Files Particulars Examples | Restrictions Literature_References Author_and_Institution Version Index_Entries

#### Procedure

       void rotmat_c ( ConstSpiceDouble   m1[3][3],
                       SpiceDouble        angle,
                       SpiceInt           iaxis,
                       SpiceDouble        mout[3][3] )

#### Abstract

       rotmat_c applies a rotation of angle radians about axis iaxis to a
       matrix.  This rotation is thought of as rotating the coordinate
       system.

#### Required_Reading

       None.

#### Keywords

       MATRIX,  ROTATION

#### Brief_I/O

       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.

#### Detailed_Input

       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,
               respectively.

#### Detailed_Output

       mout    The matrix resulting from the application of the
               specified rotation to the input matrix m1.  If

                  [angle]
                        iaxis

               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
                                iaxis

               mout can overwrite m1.

#### Parameters

       None.

#### Exceptions

       Error free.

       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.

#### Files

       None.

#### Particulars

       None.

#### Examples

       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 );

#### Restrictions

       None.

#### Literature_References

       None.

#### Author_and_Institution

       N.J. Bachman    (JPL)
       W.M. Owen       (JPL)
       W.L. Taber      (JPL)

#### Version

       -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)

#### Index_Entries

       rotate a matrix

#### Link to routine rotmat_c source file rotmat_c.c

    Wed Apr  5 17:54:42 2017