invert_c

Index Page invert_c
A B C D E F G H I J K L M N O P Q R S T U V W X
Procedure Abstract Required_Reading Keywords Brief_I/O Detailed_Input | Detailed_Output Parameters Exceptions Files Particulars Examples | Restrictions Literature_References Author_and_Institution Version Index_Entries
#### Procedure
       void invert_c ( ConstSpiceDouble  m1  [3][3],
                       SpiceDouble       mout[3][3] )
#### Abstract
       Generate the inverse of a 3x3 matrix.
#### Required_Reading
       None.
#### Keywords
       MATRIX,  MATH
#### Brief_I/O
       VARIABLE  I/O  DESCRIPTION
       --------  ---  --------------------------------------------------
       m1         I   Matrix to be inverted.
       mout       O   Inverted matrix (m1)**-1.  If m1 is singular, then
                      mout will be the zero matrix.   mout can
                      overwrite m1.
#### Detailed_Input
       m1    An arbitrary 3x3 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.
#### Detailed_Output
       mout  is the inverse of m1 and is calculated explicitly using
             the matrix of cofactors.  mout is set to be the zero matrix
             if m1 is singular.
#### Parameters
       None.
#### Exceptions
       1) No internal checking on the input matrix m1 is performed except on
          the size of its determinant.  Thus it is possible to generate a
          floating point overflow or underflow in the process of
          calculating the matrix of cofactors.

       2) If the determinant is less than 10**-16, the matrix is deemed to
          be singular and the output matrix is filled with zeros.
#### Files
       None
#### Particulars
       A temporary matrix is used to compute the result, so the output
       matrix may overwrite the input matrix.
#### Examples
       Suppose that m1 is given by the following matrix equation:

               | 0   -1    0 |
          m1 = | 0.5  0    0 |
               | 0    0    1 |

       If invert_c is called as shown

          invert_c (m1, m1);

       then m1 will be set to be:

               | 0    2    0 |
          m1 = |-1    0    0 |
               | 0    0    1 |
#### Restrictions
       The input matrix must be such that generating the cofactors will
       not cause a floating point overflow or underflow.  The
       strictness of this condition depends, of course, on the computer
       installation and the resultant maximum and minimum values of
       double precision numbers.
#### Literature_References
       None
#### Author_and_Institution
       W.M. Owen       (JPL)
#### Version
      -CSPICE Version 1.0.0, 13-SEP-1999 (NJB) (WMO)
#### Index_Entries
       invert a 3x3_matrix
#### Link to routine invert_c source file invert_c.c

    Thu Apr 16 08:58:22 2009