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.
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.
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.
None.
ICY.REQ
Icy Version 1.0.1, 13JUN2011, EDW (JPL)
Edits to comply with NAIF standard for Icy headers. Expanded variable
descriptions in I/O section.
Icy Version 1.0.0, 16JUN2003, EDW (JPL)
invert a 3x3 matrix
