CSPICE_RAXISA computes the axis of the rotation given by an
input matrix and the angle of the rotation about that axis.
For important details concerning this module's function, please refer to
the CSPICE routine raxisa_c.
matrix a double precision 3x3 rotation matrix.
cspice_raxisa, matrix, axis, angle
axis is a unit vector pointing along the axis of the rotation.
In other words, `axis' is a unit eigenvector of the input
matrix, corresponding to the eigenvalue 1. If the input
matrix is the identity matrix, `axis' will be the vector
(0, 0, 1). If the input rotation is a rotation by pi
radians, both `axis' and -axis may be regarded as the
axis of the rotation.
angle is the scalar, double precision angle between 'v' and
matrix*'v' for any non-zero vector 'v' orthogonal to
'axis'. 'angle' is given in radians. The angle returned
will be in the range from 0 to pi radians.
Please note cspice_raxisa is not guaranteed to invert the
operation of cspice_axisar.
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.
;; Define an axis and an angle for rotation.
axis = [ 1.d, 2.d, 3.d ]
angle = .1d * cspice_twopi()
;; Determine the rotation matrix.
cspice_axisar, axis, angle, rot_mat
;; Now calculate the rotation axis and angle based on the
;; matrix as input.
cspice_raxisa, rot_mat, axout, angout
;; Now input the axout and angout to cspice_axisar to
;; compare against the original rotation matrix rot_mat.
cspice_axisar, axout, angout, rot_out
print, print, rot_mat - rot_out
IDL outputs for 'axout' : 0.26726124 0.53452248 0.80178373
IDL outputs for 'angout': 0.62831853
IDL outputs for 'rot_mat - rot_out':
0.0000000 -1.1102230e-16 5.5511151e-17
1.1102230e-16 0.0000000 0.0000000
-5.5511151e-17 2.7755576e-17 0.0000000
The zero matrix accurate to round-off error. A numerical
demonstration of equality.
-Icy Version 1.1.0, 5-JAN-2005, EDW (JPL)
-Icy Version 1.0.0, 16-JUN-2003, EDW (JPL)
rotation axis of a matrix