Table of contents
CSPICE_INVORT constructs the inverse of a 3x3 matrix with orthogonal
columns and non-zero column norms using a numerically stable algorithm.
The rows of the output matrix are the columns of the input matrix divided
by the length squared of the corresponding columns.
Given:
m a 3x3 double precision matrix.
help, m
DOUBLE = Array[3,3]
the call:
cspice_invort, m, mit
returns:
mit double precision 3x3 matrix describing the matrix obtained by
transposing 'm' and dividing the rows by squares of their norms.
help, mit
DOUBLE = Array[3,3]
None.
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) Given a double precision 3x3 matrix with mutually orthogonal
rows of arbitrary length, compute its inverse. Check that the
original matrix times the computed inverse produces the
identity matrix.
Example code begins here.
PRO invort_ex1
;;
;; Define a matrix to invert.
;;
m = [ [ 0, -1.d, 0], [ 0.5d, 0, 0], [ 0, 0, 1.d] ]
print, 'Original matrix: '
print, m
print, ''
;;
;; Invert the matrix, then output.
;;
cspice_invort, m, mout
print,'Inverse matrix: '
print, mout
print, ''
;;
;; Check the `m' times `mout' produces the identity matrix.
;;
print, 'Original times inverse: '
print, m ## mout
END
When this program was executed on a Mac/Intel/IDL8.x/64-bit
platform, the output was:
Original matrix:
0.0000000 -1.0000000 0.0000000
0.50000000 0.0000000 0.0000000
0.0000000 0.0000000 1.0000000
Inverse matrix:
0.0000000 2.0000000 0.0000000
-1.0000000 0.0000000 0.0000000
0.0000000 0.0000000 1.0000000
Original times inverse:
1.0000000 0.0000000 0.0000000
0.0000000 1.0000000 0.0000000
0.0000000 0.0000000 1.0000000
Suppose that `m' is the matrix
.- -.
| A*u B*v C*w |
| 1 1 1 |
| |
| A*u B*v C*w |
| 2 2 2 |
| |
| A*u B*v C*w |
| 3 3 3 |
`- -'
where the vectors (u , u , u ), (v , v , v ), and (w , w , w )
1 2 3 1 2 3 1 2 3
are unit vectors. This routine produces the matrix:
.- -.
| a*u a*u a*u |
| 1 2 3 |
| |
| b*v b*v b*v |
| 1 2 3 |
| |
| c*w c*w c*w |
| 1 2 3 |
`- -'
where a = 1/A, b = 1/B, and c = 1/C.
1) If any of the columns of `m' have zero length, the error
SPICE(ZEROLENGTHCOLUMN) is signaled by a routine in the call
tree of this routine.
2) If any column is too short to allow computation of the
reciprocal of its length without causing a floating point
overflow, the error SPICE(COLUMNTOOSMALL) is signaled by a
routine in the call tree of this routine.
3) If the input argument `m' is undefined, an error is signaled
by the IDL error handling system.
4) If the input argument `m' is not of the expected type, or it
does not have the expected dimensions and size, an error is
signaled by the Icy interface.
5) If the output argument `mit' is not a named variable, an error
is signaled by the Icy interface.
None.
None.
ICY.REQ
None.
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Icy Version 1.0.1, 01-NOV-2021 (JDR)
Edited the header to comply with NAIF standard. Added
complete code example. Extended -Abstract section.
Added -Parameters, -Exceptions, -Files, -Restrictions,
-Literature_References and -Author_and_Institution sections, and
completed -Particulars section.
Removed reference to the routine's corresponding CSPICE header from
-Abstract section.
Added arguments' type and size information in the -I/O section.
-Icy Version 1.0.0, 14-NOV-2013 (EDW)
Transpose a matrix and invert the lengths of the rows
Invert a pseudo orthogonal matrix
|