Index Page
cspice_invert
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_INVERT calculates the inverse of a double precision 3x3
   matrix.

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

I/O


   Given:

      m1   an arbitrary 3x3 double precision matrix. The limits on the size
           of elements of 'm1' are determined by the process of calculating
           the cofactors of each element of the matrix. For a 3x3
           matrix this amounts to the differencing of two terms, each
           of which consists of the multiplication of two matrix
           elements.  This multiplication must not exceed the range
           of double precision numbers or else an overflow error will
           occur.

   the call:

      cspice_invert, m1, mout

   returns:

      mout   the double precision matrix, inverse of 'm1' and is calculated
             explicitly using the matrix of cofactors. 'mout' is set to be the
             zero matrix if 'm1' is singular.

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.


      ;;
      ;; Define a simple matrix to invert.
      ;;
      m1 = [ [ 0, -1, 0], [ 0.5d, 0, 0], [ 0, 0, 1] ]

      ;;
      ;; Invert the matrix, then output.
      ;;
      cspice_invert, m1, mout
      print, mout

   IDL outputs:

          0.0000000       2.0000000       0.0000000
         -1.0000000       0.0000000       0.0000000
          0.0000000       0.0000000       1.0000000


      ;;
      ;; Check the 'm1' times 'mout' produces the identity matrix.
      ;;
      print, m1 ## mout

   IDL outputs:

          1.0000000       0.0000000       0.0000000
          0.0000000       1.0000000       0.0000000
          0.0000000       0.0000000       1.0000000

   The identity matrix, as expected.

Particulars


   None.

Required Reading


   ICY.REQ

Version


   -Icy Version 1.0.1, 13-JUN-2011, EDW (JPL)

      Edits to comply with NAIF standard for Icy headers. Expanded variable
      descriptions in I/O section.

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

Index_Entries


   invert a 3x3 matrix




Wed Apr  5 17:58:02 2017