rotmat_c |
Table of contents
Procedurerotmat_c ( Rotate a matrix ) void rotmat_c ( ConstSpiceDouble m1[3][3], SpiceDouble angle, SpiceInt iaxis, SpiceDouble mout[3][3] ) AbstractApply a rotation of `angle' radians about axis `iaxis' to a matrix. This rotation is thought of as rotating the coordinate system. Required_ReadingNone. KeywordsMATRIX ROTATION Brief_I/OVARIABLE 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_Inputm1 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 is the angle in radians through which the original coordinate system is to be rotated. iaxis is 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_Outputmout is 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. ParametersNone. ExceptionsError 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. FilesNone. ParticularsNone. ExamplesSuppose 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 inertial to body fixed. rotmat_c ( id, r, 1, m1 ); rotmat_c ( m1, p, 2, m2 ); rotmat_c ( m2, y, 3, tibf ); RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionN.J. Bachman (JPL) J. Diaz del Rio (ODC Space) W.M. Owen (JPL) W.L. Taber (JPL) Version-CSPICE Version 1.1.1, 13-AUG-2021 (JDR) Edited the header to comply with NAIF standard. -CSPICE Version 1.1.0, 22-OCT-1998 (NJB) Made input matrix const. -CSPICE Version 1.0.0, 08-FEB-1998 (NJB) (WMO) (WLT) Based on SPICELIB Version 1.0.1, 10-MAR-1992 (WLT) Index_Entriesrotate a matrix |
Fri Dec 31 18:41:11 2021