rotate |
Table of contents
ProcedureROTATE ( Generate a rotation matrix ) SUBROUTINE ROTATE ( ANGLE, IAXIS, MOUT ) AbstractCalculate the 3x3 rotation matrix generated by a rotation of a specified angle about a specified axis. This rotation is thought of as rotating the coordinate system. Required_ReadingNone. KeywordsMATRIX ROTATION DeclarationsIMPLICIT NONE DOUBLE PRECISION ANGLE INTEGER IAXIS DOUBLE PRECISION MOUT ( 3,3 ) Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- ANGLE I Angle of rotation (radians). IAXIS I Axis of rotation (X=1, Y=2, Z=3). MOUT O Resulting rotation matrix [ANGLE] IAXIS Detailed_InputANGLE is the angle, given in radians, through which the rotation is performed. IAXIS is the index of the axis of rotation. The X, Y, and Z axes have indices 1, 2 and 3 respectively. Detailed_OutputMOUT is the rotation matrix which describes the rotation of a reference frame through ANGLE radians about the axis whose index is IAXIS. 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. ParticularsA rotation about the first, i.e. x-axis, is described by .- -. | 1 0 0 | | 0 cos(theta) sin(theta) | | 0 -sin(theta) cos(theta) | `- -' A rotation about the second, i.e. y-axis, is described by .- -. | cos(theta) 0 -sin(theta) | | 0 1 0 | | sin(theta) 0 cos(theta) | `- -' A rotation about the third, i.e. z-axis, is described by .- -. | cos(theta) sin(theta) 0 | | -sin(theta) cos(theta) 0 | | 0 0 1 | `- -' ROTATE decides which form is appropriate according to the value of IAXIS. ExamplesIf ROTATE is called from a FORTRAN program as follows: CALL ROTATE (PI/4, 3, MOUT) then MOUT will be given by | SQRT(2)/2 SQRT(2)/2 0 | MOUT = |-SQRT(2)/2 SQRT(2)/2 0 | | 0 0 1 | RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionJ. Diaz del Rio (ODC Space) W.M. Owen (JPL) W.L. Taber (JPL) VersionSPICELIB Version 1.1.0, 25-MAY-2021 (JDR) Added IMPLICIT NONE statement. Edited the header to comply with NAIF standard. SPICELIB Version 1.0.1, 10-MAR-1992 (WLT) Comment section for permuted index source lines was added following the header. SPICELIB Version 1.0.0, 31-JAN-1990 (WMO) (WLT) |
Fri Dec 31 18:36:44 2021