cspice_rotmat

 Abstract I/O Examples Particulars Required Reading Version Index_Entries
```
```

#### Abstract

```
CSPICE_ROTMAT calculates the 3x3 rotation matrix generated by
a rotation of a specified angle about a specified axis applied
to a matrix. This rotation is thought of as rotating the
coordinate system.

For important details concerning this module's function, please refer to
the CSPICE routine rotmat_c.

```

#### I/O

```
Given:

m1      the double precision 3x3 array on which to apply the rotation.
In matrix algebra, the components of the matrix are
relative to one particular coordinate system. Applying
cspice_rotmat changes the components of 'm1' so that they are
relative to a rotated coordinate system.

angle   the double precision scalar angle in radians through which
to rotate the original coordinate system

iaxis   the scalar integer index for the axis of the original
coordinate system about which to perform the rotation by
'angle'. 'iaxis' = 1,2 or 3 respectively designates the
x-, y-, or z-axis.

the call:

cspice_rotmat, m1, angle, iaxis, mout

returns:

mout    a double precision 3x3 array resulting from the application of
'angle' 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

```

#### Examples

```
Any numerical results shown for this example may differ between
platforms as the results depend on the SPICE kernels used as input
and the machine specific arithmetic implementation.

;;
;; Rotate the 3x3 identity matrix by 90 degrees about
;; the y axis.
;;

;;
;; Create the 3x3 identity matrix.
;;
cspice_ident, ident

;;
;; Rotate 'ident' by Pi/2 about the Y axis.
;;
cspice_rotmat, ident, cspice_halfpi(), 2, r

;;
;; Output the resulting matrix.
;;
print, r

IDL outputs for r:

6.1230318e-17       0.0000000      -1.0000000
0.0000000       1.0000000       0.0000000
1.0000000       0.0000000   6.1230318e-17

Numerically equivalent to the expected

0  0 -1
0  1  0
1  0  0

```

#### Particulars

```
The call has the effect of:

cspice_rotate, angle, iaxis, r
cspice_mxm, r, m1, mout

```

```
ICY.REQ
ROTATION.REQ

```

#### Version

```
-Icy Version 1.0.2, 08-JAN-2008, EDW (JPL)

Rewrote the I/O descriptions. The 1.0.1 version of this file
lacked complete descriptions of the arguments. Included functional
example code.

-Icy Version 1.0.1, 09-DEC-2005, EDW (JPL)

-Icy Version 1.0.0, 16-JUN-2003, EDW (JPL)

```

#### Index_Entries

```
rotate a matrix

```
`Wed Apr  5 17:58:03 2017`