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