1 /*
2  *  - - - - - - - - - -
3  *   g a l _ e e 0 0 a
4  *  - - - - - - - - - -
5  *
6  *  This routine is part of the General Astrodynamics Library
7  *
8  *  Description:
9  *
10  *  Equation of the equinoxes, compatible with IAU 2000 resolutions.
11  *
12  *  This routine is an independent translation of a FORTRAN routine
13  *  that is part of IAU's SOFA software collection.
14  *
15  *  Status:
16  *
17  *     support routine.
18  *
19  *  Given:
20  *
21  *     date1,date2         d        TT as a 2-part Julian Date (Note 1)
22  *
23  *  Returned:
24  *
25  *     gal_ee00a           d        equation of the equinoxes (Note 2)
26  *
27  *  Notes:
28  *
29  *  1) The TT date date1+date2 is a Julian Date, apportioned in any
30  *     convenient way between the two arguments.  For example,
31  *     JD(TT)=2450123.7 could be expressed in any of these ways,
32  *     among others:
33  *
34  *            date1         date2
35  *
36  *         2450123.7          0.0        (JD method)
37  *         2451545.0      -1421.3        (J2000 method)
38  *         2400000.5      50123.2        (MJD method)
39  *         2450123.5          0.2        (date & time method)
40  *
41  *     The JD method is the most natural and convenient to use in
42  *     cases where the loss of several decimal digits of resolution
43  *     is acceptable.  The J2000 method is best matched to the way
44  *     the argument is handled internally and will deliver the
45  *     optimum resolution.  The MJD method and the date & time methods
46  *     are both good compromises between resolution and convenience.
47  *
48  *  2) The result, which is in radians, operates in the following sense:
49  *
50  *        Greenwich apparent ST = GMST + equation of the equinoxes
51  *
52  *  3) The result is compatible with the IAU 2000 resolutions.  For
53  *     further details, see IERS Conventions 2003 and Capitaine et al.
54  *     (2002).
55  *
56  *  Called:
57  *
58  *     gal_pr00           IAU 2000 precession adjustments
59  *     gal_obl80          mean obliquity, IAU 1980
60  *     gal_nut00a         nutation, IAU 2000A
61  *     gal_ee00           equation of the equinoxes, IAU 2000
62  *
63  *  References:
64  *
65  *     Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
66  *     implement the IAU 2000 definition of UT1", Astronomy &
67  *     Astrophysics, 406, 1135-1149 (2003)
68  *
69  *     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
70  *     IERS Technical Note No. 32, BKG (2004)
71  *
72  *  This revision:
73  *
74  *     2006 November 13 ( c version 2008 January 18 )
75  *
76  *
77  *  Copyright (C) 2008 Paul C. L. Willmott. See notes at end.
78  *
79  *-----------------------------------------------------------------------
80  */
81 
82 #include "gal_ee00a.h"
83 #include "gal_pr00.h"
84 #include "gal_obl80.h"
85 #include "gal_nut00a.h"
86 #include "gal_ee00.h"
87 
88 double
gal_ee00a(double date1,double date2)89 gal_ee00a
90  (
91     double date1,
92     double date2
93  )
94 {
95 
96     double dpsipr, depspr, epsa, dpsi, deps ;
97 
98 /*
99  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
100  */
101 
102 /*
103  * IAU 2000 precession-rate adjustments.
104  */
105 
106     gal_pr00 ( date1, date2, &dpsipr, &depspr ) ;
107 
108 /*
109  * Mean obliquity, consistent with IAU 2000 precession-nutation.
110  */
111 
112     epsa = gal_obl80 ( date1, date2 ) + depspr ;
113 
114 /*
115  * Nutation in longitude.
116  */
117 
118     gal_nut00a ( date1, date2, &dpsi, &deps ) ;
119 
120 /*
121  * Equation of the equinoxes.
122  */
123 
124     return gal_ee00 ( date1, date2, epsa, dpsi ) ;
125 
126 /*
127  * Finished.
128  */
129 
130 }
131 
132 /*
133  *  gal - General Astrodynamics Library
134  *  Copyright (C) 2008 Paul C. L. Willmott
135  *
136  *  This program is free software; you can redistribute it and/or modify
137  *  it under the terms of the GNU General Public License as published by
138  *  the Free Software Foundation; either version 2 of the License, or
139  *  (at your option) any later version.
140  *
141  *  This program is distributed in the hope that it will be useful,
142  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
143  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
144  *  GNU General Public License for more details.
145  *
146  *  You should have received a copy of the GNU General Public License along
147  *  with this program; if not, write to the Free Software Foundation, Inc.,
148  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
149  *
150  *  Contact:
151  *
152  *  Paul Willmott
153  *  vp9mu@amsat.org
154  */
155