Index Page
cspice_rav2xf
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_RAV2XF determines the state transformation matrix
   from a rotation matrix and the angular velocity of the
   rotation.

I/O


   Given:

      rot   rotation matrix/matrices that give the transformation from
            some frame "frame1" to another frame "frame2".

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

            or

            [3,3,n] = size(rot); double = class(rot)

      av    the angular velocities vector/array of the transformation(s).

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

            or

            [3,n]   = size(av); double = class(av)

            If 'p' is the position of a fixed point in "frame2,"
            then from the point of view of "frame1," 'p' rotates
            (in a right handed sense) about an axis parallel to
            'av'.  Moreover the rate of rotation in radians per unit
            time is given by the length of 'av'.

            More formally, the velocity 'v' of 'p' in "frame1" is
            given by
                                  t
               v  = av x ( rot * p )

            The components of 'av' are given relative to "frame1."

   the call:

      xform = cspice_rav2xf(rot, av)

   returns:

      xform   the matrix/matrices of state transformations associated
              with 'rot' and 'av'. 

              If    [3,3]   = size(rot)
              then  [6,6]   = size(xform); double = class(xform)

              If    [3,3,n] = size(rot)
              then  [6,6,n] = size(xform); double = class(xform)

              If 's1' is the state of an object with respect to "frame1",
              then the state 's2' of the object with respect to "frame2"
             is given by

                 s2  =  xform * s1

              where "*" denotes matrix-vector multiplication.

              'xform' returns with the same vectorization measure, N,
              as 'rot' and 'av'.

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(1):

      %
      %  Load a set of kernels: an SPK file, a PCK file
      %  and a leapseconds file. Use a meta kernel
      %  for convenience.
      %
      cspice_furnsh( 'standard.tm' )

      %
      % Define an angular velocity vector:
      %
      e1     =  [ 1.;   0.;  0. ];

      %
      % Rotation matrix for "elementary" frame rotations:  90 degrees
      % about the z axes:
      %
      rz_90 = [[ 0.,  1.,  0. ]; ...
               [-1.,  0.,  0. ]; ...
               [ 0.,  0.,  1. ] ];

      %
      % The call cspice_rav2xf calculates the state transformation matrix
      % 'strans' associated with the angular velocity vector and the
      % rotation matrix.
      %
      strans = cspice_rav2xf( rz_90, e1 );

      %
      % cspice_xf2rav converts a state transformation to the associated
      % rotation matrix and angular velocity vector - inverting
      % the operation of cspice_rav2xf
      %
      [rot, av ] = cspice_xf2rav(strans);

      %
      % Calculate the maximum value of the absolute difference between the
      % output 'av' and 'rot' vs the inputs 'e1' and 'rz-90'.
      %
      disp( 'Scalar:' )
      fprintf(                                                              ...
         'Maximum absolute difference between rotation matrices: %8.6e\n', ...
                                              max( max( abs(rot - rz_90) ) )  )
      fprintf(                                                              ...
         'Maximum absolute difference between angular velocities: %8.6e\n', ...
                                              max( max(av - e1 ) )            )

   MATLAB outputs:

      Maximum absolute difference between rotation matrices: 0.000000e+00
      Maximum absolute difference between angular velocities: 0.000000e+00

      Numerical equivalent as expected.

      Example(2):

      %
      % Create an array of 10001 ephemeris times based at July 1 2007.
      %
      et    = [0: 10000]* cspice_spd + cspice_str2et( 'July 1 2007' );

      %
      % Calculate the state transformation matrices from J2000 to IAU_MOON
      % for 'et'.
      %
      xform = cspice_sxform( 'J2000', 'IAU_MOON', et );

      %
      % Convert the set of 'xform' matrices to the corresponding rotation
      % matrices and angular velocity vectors.
      %
      [ rot, av ] = cspice_xf2rav(xform);

      %
      % Use the converted outputs from cspice_xf2rav to recompute a set
      % of state transformation matrices.
      %
      strans = cspice_rav2xf( rot, av );

      %
      % Calculate the maximum value of the absolute difference between
      % 'xform' and 'strans'.
      %
      disp( 'Vector:' )
      fprintf(                                                              ...
         'Maximum absolute difference between rotation matrices: %8.6e\n', ...
                                   max( max( max( abs(strans - xform) ) ) )   )

      %
      %  It's always good form to unload kernels after use,
      %  particularly in MATLAB due to data persistence.
      %
      cspice_kclear

   MATLAB outputs:

      Vector:
      Maximum absolute difference between rotation matrices: 1.694066e-21

      In this case, a value on the order of -21 indicates numerical
      equivalence.

Particulars


   This routine is an inverse of the routine cspice_xf2rav.

Required Reading


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

   MICE.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.1, 06-MAY-2009, EDW (JPL)

      Added MICE.REQ reference to the Required Reading section.

   -Mice Version 1.0.0, 11-APR-2007, EDW (JPL)

Index_Entries


  State transformation to rotation and angular velocity


Wed Apr  5 18:00:34 2017