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

Table of contents
Abstract
I/O
Parameters
Examples
Particulars
Exceptions
Files
Restrictions
Required_Reading
Literature_References
Author_and_Institution
Version
Index_Entries


Abstract


   CSPICE_INVSTM returns the inverse of a state transformation matrix.

I/O


   Given:

      mat      a state transformation matrix for converting states relative
               to one frame to states relative to another.

               help, mat
                  DOUBLE = Array[6,6]

               The state transformation of a state vector, `s', is performed
               by the matrix-vector product.

                  mat * s.

               For `mat' to be a "true" state transformation matrix
               it must have the form

                   .-            -.
                   |       :      |
                   |   r   :   0  |
                   |.......:......|
                   |       :      |
                   |  w*r  :   r  |
                   |       :      |
                   `-            -'

               where `r' is a 3x3 rotation matrix, 0 is the 3x3 zero
               matrix and `w' is a 3x3 skew-symmetric matrix.

               NOTE: no checks are performed on `mat' to ensure that it
                     does indeed have the form described above.

   the call:

      cspice_invstm, mat, invmat

   returns:

      invmat   the inverse of `mat' under the operation of matrix
               multiplication.

               help, invmat
                  DOUBLE = Array[6,6]

               If `mat' has the form described above, then `invmat' has
               the form shown below.

                  .-             -.
                  |     t  :      |
                  |    r   :   0  |
                  |........:......|
                  |      t :    t |
                  | (w*r)  :   r  |
                  |        :      |
                  `-             -'

               (The superscript "t" denotes the matrix transpose
               operation.)

Parameters


   None.

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.

   1) Suppose you have a geometric state of a spacecraft in Earth
      body-fixed reference frame and wish to express this state
      relative to an Earth centered J2000 frame. The following
      example code illustrates how to carry out this computation.

      Use the PCK kernel below to load the required high precision
      orientation of the ITRF93 Earth body-fixed reference frame.
      Note that the body ID code used in this file for the Earth is
      3000.

         earth_720101_070426.bpc


      Example code begins here.


      PRO invstm_ex1

         ;;
         ;; Define the state of the spacecraft, in km and
         ;; km/s, and the `et' epoch, in seconds past J2000.
         ;;
         et     = 0.D0
         state  = [ 175625246.2910042D0,  164189388.1254006D0,               $
                    -62935198.26067264D0, 11946.73372264D0,                  $
                    -12771.29732556D0,    13.84902914D0 ]

         ;;
         ;; Load the required high precision Earth PCK.
         ;;
         cspice_furnsh, 'earth_720101_070426.bpc'

         ;;
         ;; First get the state transformation from J2000 frame
         ;; to Earth body-fixed frame at the time of interest `et'.
         ;; The body ID code used in high precision PCK files for
         ;; the Earth is 3000; this number indicates that the
         ;; terrestrial frame used is ITRF93.
         ;;
         earth  = 3000L
         cspice_tisbod, 'J2000', earth, et, mat

         ;;
         ;; Get the inverse of `mat'.
         ;;
         cspice_invstm, mat, invmat

         ;;
         ;; Transform from bodyfixed state to inertial state.
         ;;
         istat1 = transpose( invmat ) # state

         ;;
         ;; Print the resulting state.
         ;;
         print, format='(A)', 'Input state in Earth centered J2000' +        $
                              ' frame, using cspice_invstm:'
         print, format='(A,3F16.3)', '   Position:', istat1[0:2]
         print, format='(A,3F16.3)', '   Velocity:', istat1[3:5]

         ;;
         ;; Compute the same state using cspice_sxform.
         ;;
         cspice_sxform, 'ITRF93', 'J2000', et, xmat
         istat2 = transpose( xmat ) # state

         print
         print, format='(A)', 'Input state in Earth centered J2000' +        $
                              ' frame, using cspice_sxform:'
         print, format='(A,3F16.3)', '   Position:', istat2[0:2]
         print, format='(A,3F16.3)', '   Velocity:', istat2[3:5]

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

      END


      When this program was executed on a Mac/Intel/IDL8.x/64-bit
      platform, the output was:


      Input state in Earth centered J2000 frame, using cspice_invstm:
         Position:   192681395.921  -143792821.383   -62934296.473
         Velocity:          30.312          32.007          13.876

      Input state in Earth centered J2000 frame, using cspice_sxform:
         Position:   192681395.921  -143792821.383   -62934296.473
         Velocity:          30.312          32.007          13.876


Particulars


   Given a matrix for transforming states relative frame 1 to
   states relative frame 2, the routine produces the inverse
   matrix. That is, it returns the matrix for transforming states
   relative to frame 2 to states relative to frame 1.

   This special routine exists because unlike the inverse of a
   rotation matrix, the inverse of a state transformation matrix,
   is NOT simply the transpose of the matrix.

Exceptions


   1)  No checks are performed to ensure that the input matrix is
       indeed a state transformation matrix.

   2)  If the input argument `mat' is undefined, an error is signaled
       by the IDL error handling system.

   3)  If the input argument `mat' is not of the expected type, or it
       does not have the expected dimensions and size, an error is
       signaled by the Icy interface.

   4)  If the output argument `invmat' is not a named variable, an
       error is signaled by the Icy interface.

Files


   None.

Restrictions


   None.

Required_Reading


   ICY.REQ
   ROTATION.REQ

Literature_References


   None.

Author_and_Institution


   J. Diaz del Rio     (ODC Space)

Version


   -Icy Version 1.0.0, 25-NOV-2021 (JDR)

Index_Entries


   inverse of state transformation matrix



Fri Dec 31 18:43:05 2021