line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#include "erfa.h" |
2
|
|
|
|
|
|
|
|
3
|
0
|
|
|
|
|
|
void eraEqec06(double date1, double date2, double dr, double dd, |
4
|
|
|
|
|
|
|
double *dl, double *db) |
5
|
|
|
|
|
|
|
/* |
6
|
|
|
|
|
|
|
** - - - - - - - - - - |
7
|
|
|
|
|
|
|
** e r a E q e c 0 6 |
8
|
|
|
|
|
|
|
** - - - - - - - - - - |
9
|
|
|
|
|
|
|
** |
10
|
|
|
|
|
|
|
** Transformation from ICRS equatorial coordinates to ecliptic |
11
|
|
|
|
|
|
|
** coordinates (mean equinox and ecliptic of date) using IAU 2006 |
12
|
|
|
|
|
|
|
** precession model. |
13
|
|
|
|
|
|
|
** |
14
|
|
|
|
|
|
|
** Given: |
15
|
|
|
|
|
|
|
** date1,date2 double TT as a 2-part Julian date (Note 1) |
16
|
|
|
|
|
|
|
** dr,dd double ICRS right ascension and declination (radians) |
17
|
|
|
|
|
|
|
** |
18
|
|
|
|
|
|
|
** Returned: |
19
|
|
|
|
|
|
|
** dl,db double ecliptic longitude and latitude (radians) |
20
|
|
|
|
|
|
|
** |
21
|
|
|
|
|
|
|
** 1) The TT date date1+date2 is a Julian Date, apportioned in any |
22
|
|
|
|
|
|
|
** convenient way between the two arguments. For example, |
23
|
|
|
|
|
|
|
** JD(TT)=2450123.7 could be expressed in any of these ways, |
24
|
|
|
|
|
|
|
** among others: |
25
|
|
|
|
|
|
|
** |
26
|
|
|
|
|
|
|
** date1 date2 |
27
|
|
|
|
|
|
|
** |
28
|
|
|
|
|
|
|
** 2450123.7 0.0 (JD method) |
29
|
|
|
|
|
|
|
** 2451545.0 -1421.3 (J2000 method) |
30
|
|
|
|
|
|
|
** 2400000.5 50123.2 (MJD method) |
31
|
|
|
|
|
|
|
** 2450123.5 0.2 (date & time method) |
32
|
|
|
|
|
|
|
** |
33
|
|
|
|
|
|
|
** The JD method is the most natural and convenient to use in |
34
|
|
|
|
|
|
|
** cases where the loss of several decimal digits of resolution |
35
|
|
|
|
|
|
|
** is acceptable. The J2000 method is best matched to the way |
36
|
|
|
|
|
|
|
** the argument is handled internally and will deliver the |
37
|
|
|
|
|
|
|
** optimum resolution. The MJD method and the date & time methods |
38
|
|
|
|
|
|
|
** are both good compromises between resolution and convenience. |
39
|
|
|
|
|
|
|
** |
40
|
|
|
|
|
|
|
** 2) No assumptions are made about whether the coordinates represent |
41
|
|
|
|
|
|
|
** starlight and embody astrometric effects such as parallax or |
42
|
|
|
|
|
|
|
** aberration. |
43
|
|
|
|
|
|
|
** |
44
|
|
|
|
|
|
|
** 3) The transformation is approximately that from mean J2000.0 right |
45
|
|
|
|
|
|
|
** ascension and declination to ecliptic longitude and latitude |
46
|
|
|
|
|
|
|
** (mean equinox and ecliptic of date), with only frame bias (always |
47
|
|
|
|
|
|
|
** less than 25 mas) to disturb this classical picture. |
48
|
|
|
|
|
|
|
** |
49
|
|
|
|
|
|
|
** Called: |
50
|
|
|
|
|
|
|
** eraS2c spherical coordinates to unit vector |
51
|
|
|
|
|
|
|
** eraEcm06 J2000.0 to ecliptic rotation matrix, IAU 2006 |
52
|
|
|
|
|
|
|
** eraRxp product of r-matrix and p-vector |
53
|
|
|
|
|
|
|
** eraC2s unit vector to spherical coordinates |
54
|
|
|
|
|
|
|
** eraAnp normalize angle into range 0 to 2pi |
55
|
|
|
|
|
|
|
** eraAnpm normalize angle into range +/- pi |
56
|
|
|
|
|
|
|
** |
57
|
|
|
|
|
|
|
** Copyright (C) 2013-2019, NumFOCUS Foundation. |
58
|
|
|
|
|
|
|
** Derived, with permission, from the SOFA library. See notes at end of file. |
59
|
|
|
|
|
|
|
*/ |
60
|
|
|
|
|
|
|
{ |
61
|
|
|
|
|
|
|
double rm[3][3], v1[3], v2[3], a, b; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
/* Spherical to Cartesian. */ |
65
|
0
|
|
|
|
|
|
eraS2c(dr, dd, v1); |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
/* Rotation matrix, ICRS equatorial to ecliptic. */ |
68
|
0
|
|
|
|
|
|
eraEcm06(date1, date2, rm); |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
/* The transformation from ICRS to ecliptic. */ |
71
|
0
|
|
|
|
|
|
eraRxp(rm, v1, v2); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
/* Cartesian to spherical. */ |
74
|
0
|
|
|
|
|
|
eraC2s(v2, &a, &b); |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
/* Express in conventional ranges. */ |
77
|
0
|
|
|
|
|
|
*dl = eraAnp(a); |
78
|
0
|
|
|
|
|
|
*db = eraAnpm(b); |
79
|
|
|
|
|
|
|
|
80
|
0
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
/*---------------------------------------------------------------------- |
82
|
|
|
|
|
|
|
** |
83
|
|
|
|
|
|
|
** |
84
|
|
|
|
|
|
|
** Copyright (C) 2013-2019, NumFOCUS Foundation. |
85
|
|
|
|
|
|
|
** All rights reserved. |
86
|
|
|
|
|
|
|
** |
87
|
|
|
|
|
|
|
** This library is derived, with permission, from the International |
88
|
|
|
|
|
|
|
** Astronomical Union's "Standards of Fundamental Astronomy" library, |
89
|
|
|
|
|
|
|
** available from http://www.iausofa.org. |
90
|
|
|
|
|
|
|
** |
91
|
|
|
|
|
|
|
** The ERFA version is intended to retain identical functionality to |
92
|
|
|
|
|
|
|
** the SOFA library, but made distinct through different function and |
93
|
|
|
|
|
|
|
** file names, as set out in the SOFA license conditions. The SOFA |
94
|
|
|
|
|
|
|
** original has a role as a reference standard for the IAU and IERS, |
95
|
|
|
|
|
|
|
** and consequently redistribution is permitted only in its unaltered |
96
|
|
|
|
|
|
|
** state. The ERFA version is not subject to this restriction and |
97
|
|
|
|
|
|
|
** therefore can be included in distributions which do not support the |
98
|
|
|
|
|
|
|
** concept of "read only" software. |
99
|
|
|
|
|
|
|
** |
100
|
|
|
|
|
|
|
** Although the intent is to replicate the SOFA API (other than |
101
|
|
|
|
|
|
|
** replacement of prefix names) and results (with the exception of |
102
|
|
|
|
|
|
|
** bugs; any that are discovered will be fixed), SOFA is not |
103
|
|
|
|
|
|
|
** responsible for any errors found in this version of the library. |
104
|
|
|
|
|
|
|
** |
105
|
|
|
|
|
|
|
** If you wish to acknowledge the SOFA heritage, please acknowledge |
106
|
|
|
|
|
|
|
** that you are using a library derived from SOFA, rather than SOFA |
107
|
|
|
|
|
|
|
** itself. |
108
|
|
|
|
|
|
|
** |
109
|
|
|
|
|
|
|
** |
110
|
|
|
|
|
|
|
** TERMS AND CONDITIONS |
111
|
|
|
|
|
|
|
** |
112
|
|
|
|
|
|
|
** Redistribution and use in source and binary forms, with or without |
113
|
|
|
|
|
|
|
** modification, are permitted provided that the following conditions |
114
|
|
|
|
|
|
|
** are met: |
115
|
|
|
|
|
|
|
** |
116
|
|
|
|
|
|
|
** 1 Redistributions of source code must retain the above copyright |
117
|
|
|
|
|
|
|
** notice, this list of conditions and the following disclaimer. |
118
|
|
|
|
|
|
|
** |
119
|
|
|
|
|
|
|
** 2 Redistributions in binary form must reproduce the above copyright |
120
|
|
|
|
|
|
|
** notice, this list of conditions and the following disclaimer in |
121
|
|
|
|
|
|
|
** the documentation and/or other materials provided with the |
122
|
|
|
|
|
|
|
** distribution. |
123
|
|
|
|
|
|
|
** |
124
|
|
|
|
|
|
|
** 3 Neither the name of the Standards Of Fundamental Astronomy Board, |
125
|
|
|
|
|
|
|
** the International Astronomical Union nor the names of its |
126
|
|
|
|
|
|
|
** contributors may be used to endorse or promote products derived |
127
|
|
|
|
|
|
|
** from this software without specific prior written permission. |
128
|
|
|
|
|
|
|
** |
129
|
|
|
|
|
|
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
130
|
|
|
|
|
|
|
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
131
|
|
|
|
|
|
|
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
132
|
|
|
|
|
|
|
** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
133
|
|
|
|
|
|
|
** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
134
|
|
|
|
|
|
|
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
135
|
|
|
|
|
|
|
** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
136
|
|
|
|
|
|
|
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
137
|
|
|
|
|
|
|
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
138
|
|
|
|
|
|
|
** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
139
|
|
|
|
|
|
|
** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
140
|
|
|
|
|
|
|
** POSSIBILITY OF SUCH DAMAGE. |
141
|
|
|
|
|
|
|
** |
142
|
|
|
|
|
|
|
*/ |