source: trunk/FACT++/erfa/src/pvxpv.c@ 19144

Last change on this file since 19144 was 18921, checked in by tbretz, 7 years ago
Updated to ERFA 1.4.0
File size: 4.3 KB
Line 
1#include "erfa.h"
2
3void eraPvxpv(double a[2][3], double b[2][3], double axb[2][3])
4/*
5** - - - - - - - - -
6** e r a P v x p v
7** - - - - - - - - -
8**
9** Outer (=vector=cross) product of two pv-vectors.
10**
11** Given:
12** a double[2][3] first pv-vector
13** b double[2][3] second pv-vector
14**
15** Returned:
16** axb double[2][3] a x b
17**
18** Notes:
19**
20** 1) If the position and velocity components of the two pv-vectors are
21** ( ap, av ) and ( bp, bv ), the result, a x b, is the pair of
22** vectors ( ap x bp, ap x bv + av x bp ). The two vectors are the
23** cross-product of the two p-vectors and its derivative.
24**
25** 2) It is permissible to re-use the same array for any of the
26** arguments.
27**
28** Called:
29** eraCpv copy pv-vector
30** eraPxp vector product of two p-vectors
31** eraPpp p-vector plus p-vector
32**
33** Copyright (C) 2013-2017, NumFOCUS Foundation.
34** Derived, with permission, from the SOFA library. See notes at end of file.
35*/
36{
37 double wa[2][3], wb[2][3], axbd[3], adxb[3];
38
39
40/* Make copies of the inputs. */
41 eraCpv(a, wa);
42 eraCpv(b, wb);
43
44/* a x b = position part of result. */
45 eraPxp(wa[0], wb[0], axb[0]);
46
47/* a x bdot + adot x b = velocity part of result. */
48 eraPxp(wa[0], wb[1], axbd);
49 eraPxp(wa[1], wb[0], adxb);
50 eraPpp(axbd, adxb, axb[1]);
51
52 return;
53
54}
55/*----------------------------------------------------------------------
56**
57**
58** Copyright (C) 2013-2017, NumFOCUS Foundation.
59** All rights reserved.
60**
61** This library is derived, with permission, from the International
62** Astronomical Union's "Standards of Fundamental Astronomy" library,
63** available from http://www.iausofa.org.
64**
65** The ERFA version is intended to retain identical functionality to
66** the SOFA library, but made distinct through different function and
67** file names, as set out in the SOFA license conditions. The SOFA
68** original has a role as a reference standard for the IAU and IERS,
69** and consequently redistribution is permitted only in its unaltered
70** state. The ERFA version is not subject to this restriction and
71** therefore can be included in distributions which do not support the
72** concept of "read only" software.
73**
74** Although the intent is to replicate the SOFA API (other than
75** replacement of prefix names) and results (with the exception of
76** bugs; any that are discovered will be fixed), SOFA is not
77** responsible for any errors found in this version of the library.
78**
79** If you wish to acknowledge the SOFA heritage, please acknowledge
80** that you are using a library derived from SOFA, rather than SOFA
81** itself.
82**
83**
84** TERMS AND CONDITIONS
85**
86** Redistribution and use in source and binary forms, with or without
87** modification, are permitted provided that the following conditions
88** are met:
89**
90** 1 Redistributions of source code must retain the above copyright
91** notice, this list of conditions and the following disclaimer.
92**
93** 2 Redistributions in binary form must reproduce the above copyright
94** notice, this list of conditions and the following disclaimer in
95** the documentation and/or other materials provided with the
96** distribution.
97**
98** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
99** the International Astronomical Union nor the names of its
100** contributors may be used to endorse or promote products derived
101** from this software without specific prior written permission.
102**
103** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
104** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
105** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
106** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
107** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
108** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
109** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
110** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
111** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
112** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
113** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
114** POSSIBILITY OF SUCH DAMAGE.
115**
116*/
Note: See TracBrowser for help on using the repository browser.