File Coverage

erfasrc/src/eceq06.c
Criterion Covered Total %
statement 0 8 0.0
branch n/a
condition n/a
subroutine n/a
pod n/a
total 0 8 0.0


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