source: trunk/MagicSoft/slalib/dvxv.c@ 6121

Last change on this file since 6121 was 731, checked in by tbretz, 24 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 825 bytes
Line 
1#include "slalib.h"
2#include "slamac.h"
3void slaDvxv ( double va[3], double vb[3], double vc[3] )
4/*
5** - - - - - - - -
6** s l a D v x v
7** - - - - - - - -
8**
9** Vector product of two 3-vectors.
10**
11** (double precision)
12**
13** Given:
14** va double[3] first vector
15** vb double[3] second vector
16**
17** Returned:
18** vc double[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 double 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++ ) {
37 vc[i] = vw[i];
38 }
39}
Note: See TracBrowser for help on using the repository browser.