Last change
on this file since 5602 was 731, checked in by tbretz, 24 years ago |
*** empty log message ***
|
-
Property svn:executable
set to
*
|
File size:
1001 bytes
|
Line | |
---|
1 | #include "slalib.h"
|
---|
2 | #include "slamac.h"
|
---|
3 | void slaDmxm ( double a[3][3], double b[3][3], double c[3][3] )
|
---|
4 | /*
|
---|
5 | ** - - - - - - - -
|
---|
6 | ** s l a D m x m
|
---|
7 | ** - - - - - - - -
|
---|
8 | **
|
---|
9 | ** Product of two 3x3 matrices:
|
---|
10 | ** matrix c = matrix a x matrix b
|
---|
11 | **
|
---|
12 | ** (double precision)
|
---|
13 | **
|
---|
14 | ** Given:
|
---|
15 | ** a double[3][3] matrix
|
---|
16 | ** b double[3][3] matrix
|
---|
17 | **
|
---|
18 | ** Returned:
|
---|
19 | ** c double[3][3] matrix result
|
---|
20 | **
|
---|
21 | ** Note: the same array may be nominated more than once.
|
---|
22 | **
|
---|
23 | ** Last revision: 6 November 1999
|
---|
24 | **
|
---|
25 | ** Copyright P.T.Wallace. All rights reserved.
|
---|
26 | */
|
---|
27 | {
|
---|
28 | int i, j, k;
|
---|
29 | double w, wm[3][3];
|
---|
30 |
|
---|
31 | /* Multiply into scratch matrix */
|
---|
32 | for ( i = 0; i < 3; i++ ) {
|
---|
33 | for ( j = 0; j < 3; j++ ) {
|
---|
34 | w = 0.0;
|
---|
35 | for ( k = 0; k < 3; k++ ) {
|
---|
36 | w += a[i][k] * b[k][j];
|
---|
37 | }
|
---|
38 | wm[i][j] = w;
|
---|
39 | }
|
---|
40 | }
|
---|
41 |
|
---|
42 | /* Return the result */
|
---|
43 | for ( j = 0; j < 3; j++ ) {
|
---|
44 | for ( i = 0; i < 3; i++ ) {
|
---|
45 | c[i][j] = wm[i][j];
|
---|
46 | }
|
---|
47 | }
|
---|
48 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.