Last change
on this file since 6181 was 732, checked in by tbretz, 24 years ago |
*** empty log message ***
|
-
Property svn:executable
set to
*
|
File size:
798 bytes
|
Line | |
---|
1 | #include "slalib.h"
|
---|
2 | #include "slamac.h"
|
---|
3 | void slaVxv ( float va[3], float vb[3], float vc[3] )
|
---|
4 | /*
|
---|
5 | ** - - - - - - -
|
---|
6 | ** s l a V x v
|
---|
7 | ** - - - - - - -
|
---|
8 | **
|
---|
9 | ** Vector product of two 3-vectors.
|
---|
10 | **
|
---|
11 | ** (single precision)
|
---|
12 | **
|
---|
13 | ** Given:
|
---|
14 | ** va float[3] first vector
|
---|
15 | ** vb float[3] second vector
|
---|
16 | **
|
---|
17 | ** Returned:
|
---|
18 | ** vc float[3] vector result
|
---|
19 | **
|
---|
20 | ** Note: the same vector may be specified more than once.
|
---|
21 | **
|
---|
22 | ** Last revision: 6 November 1999
|
---|
23 | **
|
---|
24 | ** Copyright P.T.Wallace. All rights reserved.
|
---|
25 | */
|
---|
26 | {
|
---|
27 | float vw[3];
|
---|
28 | int i;
|
---|
29 |
|
---|
30 | /* Form the vector product va cross vb */
|
---|
31 | vw[0] = va[1] * vb[2] - va[2] * vb[1];
|
---|
32 | vw[1] = va[2] * vb[0] - va[0] * vb[2];
|
---|
33 | vw[2] = va[0] * vb[1] - va[1] * vb[0];
|
---|
34 |
|
---|
35 | /* Return the result */
|
---|
36 | for ( i = 0; i < 3; i++ ) vc[i] = vw[i];
|
---|
37 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.