void mxm_c ( ConstSpiceDouble m1 [3][3],
ConstSpiceDouble m2 [3][3],
SpiceDouble mout[3][3] )
Multiply two 3x3 matrices.
None.
MATRIX
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
m1 i 3x3 double precision matrix.
m2 i 3x3 double precision matrix.
mout o 3x3 double precision matrix. mout is the product
m1*m2.
m1 is an arbitrary 3x3 double precision matrix.
m2 is an arbitrary 3x3 double precision matrix.
mout is a 3x3 double precision matrix. mout is the product
m1*m2. mout may overwrite either m1 or m2.
None.
Error free.
None.
The code reflects precisely the following mathematical expression
For each value of the subscripts i and j from 1 to 3:
mout(i,j) = summation from k=1 to 3 of ( m1(i,k) * m2(k,j) )
The intermediate results of the operation above are buffered in a
temporary matrix which is later moved to the output matrix.
Thus, to save space in the calling program, mout can be actually
be m1 or m2 if desired without interfering with the computations.
Let m1 = | 1. 1. 0. |
| |
| -1. 1. 0. |
| |
| 0. 0. 1. |
and m2 = | 1. 0. 0. |
| |
| 0. 1. 1. |
| |
| 0. -1. 1. |
then the call
mxm_c ( m1, m2, mout );
produces the matrix
mout = | 1. 1. 1. |
| |
| -1. 1. 1. |
| |
| 0. -1. 1. |
None.
None.
E.D. Wright (JPL)
W.M. Owen (JPL)
-CSPICE Version 1.0.0, 16-APR-1999 (EDW)
matrix times matrix 3x3_case
Link to routine mxm_c source file mxm_c.c
|