source: trunk/FACT++/sofa/src/pvxpv.c@ 18369

Last change on this file since 18369 was 18346, checked in by tbretz, 11 years ago
File size: 5.7 KB
Line 
1#include "sofa.h"
2
3void iauPvxpv(double a[2][3], double b[2][3], double axb[2][3])
4/*
5** - - - - - - - - -
6** i a u P v x p v
7** - - - - - - - - -
8**
9** Outer (=vector=cross) product of two pv-vectors.
10**
11** This function is part of the International Astronomical Union's
12** SOFA (Standards Of Fundamental Astronomy) software collection.
13**
14** Status: vector/matrix support function.
15**
16** Given:
17** a double[2][3] first pv-vector
18** b double[2][3] second pv-vector
19**
20** Returned:
21** axb double[2][3] a x b
22**
23** Notes:
24**
25** 1) If the position and velocity components of the two pv-vectors are
26** ( ap, av ) and ( bp, bv ), the result, a x b, is the pair of
27** vectors ( ap x bp, ap x bv + av x bp ). The two vectors are the
28** cross-product of the two p-vectors and its derivative.
29**
30** 2) It is permissible to re-use the same array for any of the
31** arguments.
32**
33** Called:
34** iauCpv copy pv-vector
35** iauPxp vector product of two p-vectors
36** iauPpp p-vector plus p-vector
37**
38** This revision: 2013 June 18
39**
40** SOFA release 2015-02-09
41**
42** Copyright (C) 2015 IAU SOFA Board. See notes at end.
43*/
44{
45 double wa[2][3], wb[2][3], axbd[3], adxb[3];
46
47/* Make copies of the inputs. */
48 iauCpv(a, wa);
49 iauCpv(b, wb);
50
51/* a x b = position part of result. */
52 iauPxp(wa[0], wb[0], axb[0]);
53
54/* a x bdot + adot x b = velocity part of result. */
55 iauPxp(wa[0], wb[1], axbd);
56 iauPxp(wa[1], wb[0], adxb);
57 iauPpp(axbd, adxb, axb[1]);
58
59 return;
60
61/*----------------------------------------------------------------------
62**
63** Copyright (C) 2015
64** Standards Of Fundamental Astronomy Board
65** of the International Astronomical Union.
66**
67** =====================
68** SOFA Software License
69** =====================
70**
71** NOTICE TO USER:
72**
73** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
74** CONDITIONS WHICH APPLY TO ITS USE.
75**
76** 1. The Software is owned by the IAU SOFA Board ("SOFA").
77**
78** 2. Permission is granted to anyone to use the SOFA software for any
79** purpose, including commercial applications, free of charge and
80** without payment of royalties, subject to the conditions and
81** restrictions listed below.
82**
83** 3. You (the user) may copy and distribute SOFA source code to others,
84** and use and adapt its code and algorithms in your own software,
85** on a world-wide, royalty-free basis. That portion of your
86** distribution that does not consist of intact and unchanged copies
87** of SOFA source code files is a "derived work" that must comply
88** with the following requirements:
89**
90** a) Your work shall be marked or carry a statement that it
91** (i) uses routines and computations derived by you from
92** software provided by SOFA under license to you; and
93** (ii) does not itself constitute software provided by and/or
94** endorsed by SOFA.
95**
96** b) The source code of your derived work must contain descriptions
97** of how the derived work is based upon, contains and/or differs
98** from the original SOFA software.
99**
100** c) The names of all routines in your derived work shall not
101** include the prefix "iau" or "sofa" or trivial modifications
102** thereof such as changes of case.
103**
104** d) The origin of the SOFA components of your derived work must
105** not be misrepresented; you must not claim that you wrote the
106** original software, nor file a patent application for SOFA
107** software or algorithms embedded in the SOFA software.
108**
109** e) These requirements must be reproduced intact in any source
110** distribution and shall apply to anyone to whom you have
111** granted a further right to modify the source code of your
112** derived work.
113**
114** Note that, as originally distributed, the SOFA software is
115** intended to be a definitive implementation of the IAU standards,
116** and consequently third-party modifications are discouraged. All
117** variations, no matter how minor, must be explicitly marked as
118** such, as explained above.
119**
120** 4. You shall not cause the SOFA software to be brought into
121** disrepute, either by misuse, or use for inappropriate tasks, or
122** by inappropriate modification.
123**
124** 5. The SOFA software is provided "as is" and SOFA makes no warranty
125** as to its use or performance. SOFA does not and cannot warrant
126** the performance or results which the user may obtain by using the
127** SOFA software. SOFA makes no warranties, express or implied, as
128** to non-infringement of third party rights, merchantability, or
129** fitness for any particular purpose. In no event will SOFA be
130** liable to the user for any consequential, incidental, or special
131** damages, including any lost profits or lost savings, even if a
132** SOFA representative has been advised of such damages, or for any
133** claim by any third party.
134**
135** 6. The provision of any version of the SOFA software under the terms
136** and conditions specified herein does not imply that future
137** versions will also be made available under the same terms and
138** conditions.
139*
140** In any published work or commercial product which uses the SOFA
141** software directly, acknowledgement (see www.iausofa.org) is
142** appreciated.
143**
144** Correspondence concerning SOFA software should be addressed as
145** follows:
146**
147** By email: sofa@ukho.gov.uk
148** By post: IAU SOFA Center
149** HM Nautical Almanac Office
150** UK Hydrographic Office
151** Admiralty Way, Taunton
152** Somerset, TA1 2DN
153** United Kingdom
154**
155**--------------------------------------------------------------------*/
156}
Note: See TracBrowser for help on using the repository browser.