| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
#include "erfa.h" |
|
2
|
|
|
|
|
|
|
|
|
3
|
0
|
|
|
|
|
|
void eraLtp(double epj, double rp[3][3]) |
|
4
|
|
|
|
|
|
|
/* |
|
5
|
|
|
|
|
|
|
** - - - - - - - |
|
6
|
|
|
|
|
|
|
** e r a L t p |
|
7
|
|
|
|
|
|
|
** - - - - - - - |
|
8
|
|
|
|
|
|
|
** |
|
9
|
|
|
|
|
|
|
** Long-term precession matrix. |
|
10
|
|
|
|
|
|
|
** |
|
11
|
|
|
|
|
|
|
** Given: |
|
12
|
|
|
|
|
|
|
** epj double Julian epoch (TT) |
|
13
|
|
|
|
|
|
|
** |
|
14
|
|
|
|
|
|
|
** Returned: |
|
15
|
|
|
|
|
|
|
** rp double[3][3] precession matrix, J2000.0 to date |
|
16
|
|
|
|
|
|
|
** |
|
17
|
|
|
|
|
|
|
** Notes: |
|
18
|
|
|
|
|
|
|
** |
|
19
|
|
|
|
|
|
|
** 1) The matrix is in the sense |
|
20
|
|
|
|
|
|
|
** |
|
21
|
|
|
|
|
|
|
** P_date = rp x P_J2000, |
|
22
|
|
|
|
|
|
|
** |
|
23
|
|
|
|
|
|
|
** where P_J2000 is a vector with respect to the J2000.0 mean |
|
24
|
|
|
|
|
|
|
** equator and equinox and P_date is the same vector with respect to |
|
25
|
|
|
|
|
|
|
** the equator and equinox of epoch epj. |
|
26
|
|
|
|
|
|
|
** |
|
27
|
|
|
|
|
|
|
** 2) The Vondrak et al. (2011, 2012) 400 millennia precession model |
|
28
|
|
|
|
|
|
|
** agrees with the IAU 2006 precession at J2000.0 and stays within |
|
29
|
|
|
|
|
|
|
** 100 microarcseconds during the 20th and 21st centuries. It is |
|
30
|
|
|
|
|
|
|
** accurate to a few arcseconds throughout the historical period, |
|
31
|
|
|
|
|
|
|
** worsening to a few tenths of a degree at the end of the |
|
32
|
|
|
|
|
|
|
** +/- 200,000 year time span. |
|
33
|
|
|
|
|
|
|
** |
|
34
|
|
|
|
|
|
|
** Called: |
|
35
|
|
|
|
|
|
|
** eraLtpequ equator pole, long term |
|
36
|
|
|
|
|
|
|
** eraLtpecl ecliptic pole, long term |
|
37
|
|
|
|
|
|
|
** eraPxp vector product |
|
38
|
|
|
|
|
|
|
** eraPn normalize vector |
|
39
|
|
|
|
|
|
|
** |
|
40
|
|
|
|
|
|
|
** References: |
|
41
|
|
|
|
|
|
|
** |
|
42
|
|
|
|
|
|
|
** Vondrak, J., Capitaine, N. and Wallace, P., 2011, New precession |
|
43
|
|
|
|
|
|
|
** expressions, valid for long time intervals, Astron.Astrophys. 534, |
|
44
|
|
|
|
|
|
|
** A22 |
|
45
|
|
|
|
|
|
|
** |
|
46
|
|
|
|
|
|
|
** Vondrak, J., Capitaine, N. and Wallace, P., 2012, New precession |
|
47
|
|
|
|
|
|
|
** expressions, valid for long time intervals (Corrigendum), |
|
48
|
|
|
|
|
|
|
** Astron.Astrophys. 541, C1 |
|
49
|
|
|
|
|
|
|
** |
|
50
|
|
|
|
|
|
|
** Copyright (C) 2013-2019, NumFOCUS Foundation. |
|
51
|
|
|
|
|
|
|
** Derived, with permission, from the SOFA library. See notes at end of file. |
|
52
|
|
|
|
|
|
|
*/ |
|
53
|
|
|
|
|
|
|
{ |
|
54
|
|
|
|
|
|
|
int i; |
|
55
|
|
|
|
|
|
|
double peqr[3], pecl[3], v[3], w, eqx[3]; |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
/* Equator pole (bottom row of matrix). */ |
|
59
|
0
|
|
|
|
|
|
eraLtpequ(epj, peqr); |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
/* Ecliptic pole. */ |
|
62
|
0
|
|
|
|
|
|
eraLtpecl(epj, pecl); |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
/* Equinox (top row of matrix). */ |
|
65
|
0
|
|
|
|
|
|
eraPxp(peqr, pecl, v); |
|
66
|
0
|
|
|
|
|
|
eraPn(v, &w, eqx); |
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
/* Middle row of matrix. */ |
|
69
|
0
|
|
|
|
|
|
eraPxp(peqr, eqx, v); |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
/* Assemble the matrix. */ |
|
72
|
0
|
0
|
|
|
|
|
for ( i = 0; i < 3; i++ ) { |
|
73
|
0
|
|
|
|
|
|
rp[0][i] = eqx[i]; |
|
74
|
0
|
|
|
|
|
|
rp[1][i] = v[i]; |
|
75
|
0
|
|
|
|
|
|
rp[2][i] = peqr[i]; |
|
76
|
|
|
|
|
|
|
} |
|
77
|
|
|
|
|
|
|
|
|
78
|
0
|
|
|
|
|
|
} |
|
79
|
|
|
|
|
|
|
/*---------------------------------------------------------------------- |
|
80
|
|
|
|
|
|
|
** |
|
81
|
|
|
|
|
|
|
** |
|
82
|
|
|
|
|
|
|
** Copyright (C) 2013-2019, NumFOCUS Foundation. |
|
83
|
|
|
|
|
|
|
** All rights reserved. |
|
84
|
|
|
|
|
|
|
** |
|
85
|
|
|
|
|
|
|
** This library is derived, with permission, from the International |
|
86
|
|
|
|
|
|
|
** Astronomical Union's "Standards of Fundamental Astronomy" library, |
|
87
|
|
|
|
|
|
|
** available from http://www.iausofa.org. |
|
88
|
|
|
|
|
|
|
** |
|
89
|
|
|
|
|
|
|
** The ERFA version is intended to retain identical functionality to |
|
90
|
|
|
|
|
|
|
** the SOFA library, but made distinct through different function and |
|
91
|
|
|
|
|
|
|
** file names, as set out in the SOFA license conditions. The SOFA |
|
92
|
|
|
|
|
|
|
** original has a role as a reference standard for the IAU and IERS, |
|
93
|
|
|
|
|
|
|
** and consequently redistribution is permitted only in its unaltered |
|
94
|
|
|
|
|
|
|
** state. The ERFA version is not subject to this restriction and |
|
95
|
|
|
|
|
|
|
** therefore can be included in distributions which do not support the |
|
96
|
|
|
|
|
|
|
** concept of "read only" software. |
|
97
|
|
|
|
|
|
|
** |
|
98
|
|
|
|
|
|
|
** Although the intent is to replicate the SOFA API (other than |
|
99
|
|
|
|
|
|
|
** replacement of prefix names) and results (with the exception of |
|
100
|
|
|
|
|
|
|
** bugs; any that are discovered will be fixed), SOFA is not |
|
101
|
|
|
|
|
|
|
** responsible for any errors found in this version of the library. |
|
102
|
|
|
|
|
|
|
** |
|
103
|
|
|
|
|
|
|
** If you wish to acknowledge the SOFA heritage, please acknowledge |
|
104
|
|
|
|
|
|
|
** that you are using a library derived from SOFA, rather than SOFA |
|
105
|
|
|
|
|
|
|
** itself. |
|
106
|
|
|
|
|
|
|
** |
|
107
|
|
|
|
|
|
|
** |
|
108
|
|
|
|
|
|
|
** TERMS AND CONDITIONS |
|
109
|
|
|
|
|
|
|
** |
|
110
|
|
|
|
|
|
|
** Redistribution and use in source and binary forms, with or without |
|
111
|
|
|
|
|
|
|
** modification, are permitted provided that the following conditions |
|
112
|
|
|
|
|
|
|
** are met: |
|
113
|
|
|
|
|
|
|
** |
|
114
|
|
|
|
|
|
|
** 1 Redistributions of source code must retain the above copyright |
|
115
|
|
|
|
|
|
|
** notice, this list of conditions and the following disclaimer. |
|
116
|
|
|
|
|
|
|
** |
|
117
|
|
|
|
|
|
|
** 2 Redistributions in binary form must reproduce the above copyright |
|
118
|
|
|
|
|
|
|
** notice, this list of conditions and the following disclaimer in |
|
119
|
|
|
|
|
|
|
** the documentation and/or other materials provided with the |
|
120
|
|
|
|
|
|
|
** distribution. |
|
121
|
|
|
|
|
|
|
** |
|
122
|
|
|
|
|
|
|
** 3 Neither the name of the Standards Of Fundamental Astronomy Board, |
|
123
|
|
|
|
|
|
|
** the International Astronomical Union nor the names of its |
|
124
|
|
|
|
|
|
|
** contributors may be used to endorse or promote products derived |
|
125
|
|
|
|
|
|
|
** from this software without specific prior written permission. |
|
126
|
|
|
|
|
|
|
** |
|
127
|
|
|
|
|
|
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
128
|
|
|
|
|
|
|
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
|
129
|
|
|
|
|
|
|
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
|
130
|
|
|
|
|
|
|
** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
|
131
|
|
|
|
|
|
|
** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
|
132
|
|
|
|
|
|
|
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
|
133
|
|
|
|
|
|
|
** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
|
134
|
|
|
|
|
|
|
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
|
135
|
|
|
|
|
|
|
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
|
136
|
|
|
|
|
|
|
** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
|
137
|
|
|
|
|
|
|
** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
138
|
|
|
|
|
|
|
** POSSIBILITY OF SUCH DAMAGE. |
|
139
|
|
|
|
|
|
|
** |
|
140
|
|
|
|
|
|
|
*/ |