Last change
on this file since 7724 was 731, checked in by tbretz, 24 years ago |
*** empty log message ***
|
-
Property svn:executable
set to
*
|
File size:
877 bytes
|
Line | |
---|
1 | #include "slalib.h"
|
---|
2 | #include "slamac.h"
|
---|
3 | void slaMxv ( float rm[3][3], float va[3], float vb[3] )
|
---|
4 | /*
|
---|
5 | ** - - - - - - -
|
---|
6 | ** s l a M x v
|
---|
7 | ** - - - - - - -
|
---|
8 | **
|
---|
9 | ** Perform the 3-d forward unitary transformation:
|
---|
10 | **
|
---|
11 | ** vector vb = matrix rm * vector va
|
---|
12 | **
|
---|
13 | ** (single precision)
|
---|
14 | **
|
---|
15 | ** Given:
|
---|
16 | ** rm float[3][3] matrix
|
---|
17 | ** va float[3] vector
|
---|
18 | **
|
---|
19 | ** Returned:
|
---|
20 | ** vb float[3] result vector
|
---|
21 | **
|
---|
22 | ** Note: va and vb may be the same array.
|
---|
23 | **
|
---|
24 | ** Last revision: 6 November 1999
|
---|
25 | **
|
---|
26 | ** Copyright P.T.Wallace. All rights reserved.
|
---|
27 | */
|
---|
28 | {
|
---|
29 | int i, j;
|
---|
30 | float w, vw[3];
|
---|
31 |
|
---|
32 | /* Matrix rm * vector va -> vector vw */
|
---|
33 | for ( j = 0; j < 3; j++ ) {
|
---|
34 | w = 0.0f;
|
---|
35 | for ( i = 0; i < 3; i++ ) {
|
---|
36 | w += rm[j][i] * va[i];
|
---|
37 | }
|
---|
38 | vw[j] = w;
|
---|
39 | }
|
---|
40 |
|
---|
41 | /* Vector vw -> vector vb */
|
---|
42 | for ( j = 0; j < 3; j++ ) {
|
---|
43 | vb[j] = vw[j];
|
---|
44 | }
|
---|
45 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.