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

Abstract
I/O
Examples
Particulars
Required Reading
Version
Index_Entries

Abstract


   CSPICE_RAXISA computes the axis of the rotation given by an input matrix
   and the angle of the rotation about that axis.

I/O


   Given:

      matrix   rotation matrix that gives the transformation from
               some frame "frame1" to another frame "frame2".

               [3,3]   = size(matrix); double = class(matrix)

   the call:

      [axis, angle] = cspice_raxisa( matrix )

   returns:

      axis   the 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.

             [3,1] = size(axis); double = class(axis)

      angle  the 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.

             [1,1] = size(angle); double = class(angle)

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.

      Example:
      %
      % Define an axis and an angle for rotation.
      %
      axis = [ 1.; 2.; 3. ];
      angle = .1 * cspice_twopi;

      %
      % Determine the rotation matrix.
      %
      rot_mat = cspice_axisar( axis, angle );

      %
      % Now calculate the rotation axis and angle based on the
      % matrix as input.
      %
      [ axout, angout ] = cspice_raxisa( rot_mat);

      %
      % Now input the axout and angout to cspice_axisar to
      % compare against the original rotation matrix rot_mat.
      %
      rot_out = cspice_axisar( axout, angout );
      rot_mat - rot_out

   MATLAB outputs:

      1.0e-15 *

                     0  -0.11102230246252   0.05551115123126
      0.11102230246252                  0                  0
     -0.05551115123126   0.02775557561563                  0

   The zero matrix accurate to round-off error. A numerical
   demonstration of equality.

Particulars


   None.

Required Reading


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

   MICE.REQ
   ROTATION.REQ

Version


   -Mice Version 1.0.2, 09-MAR-2015, EDW (JPL)

      Edited I/O section to conform to NAIF standard for Mice documentation.

   -Mice Version 1.0.0, 29-NOV-2005, EDW (JPL)

Index_Entries


   rotation axis of a matrix


Wed Apr  5 18:00:34 2017