Skip to main content

sofars/erst/
ee00b.rs

1use super::ee00;
2use crate::pnp::{nut00b, obl80, pr00};
3
4///  Equation of the equinoxes, IAU 2000B
5///
6///  Equation of the equinoxes, compatible with IAU 2000 resolutions but
7///  using the truncated nutation model IAU 2000B.
8///
9///  This function is part of the International Astronomical Union's
10///  SOFA (Standards of Fundamental Astronomy) software collection.
11///
12///  Status:  support function.
13///
14///  Given:
15///     date1,date2  double    TT as a 2-part Julian Date (Note 1)
16///
17///  Returned (function value):
18///                  double    equation of the equinoxes (Note 2)
19///
20///  Notes:
21///
22///  1) The TT date date1+date2 is a Julian Date, apportioned in any
23///     convenient way between the two arguments.  For example,
24///     JD(TT)=2450123.7 could be expressed in any of these ways,
25///     among others:
26///  ```
27///            date1          date2
28///
29///         2450123.7           0.0       (JD method)
30///         2451545.0       -1421.3       (J2000 method)
31///         2400000.5       50123.2       (MJD method)
32///         2450123.5           0.2       (date & time method)
33///  ```
34///     The JD method is the most natural and convenient to use in
35///     cases where the loss of several decimal digits of resolution
36///     is acceptable.  The J2000 method is best matched to the way
37///     the argument is handled internally and will deliver the
38///     optimum resolution.  The MJD method and the date & time methods
39///     are both good compromises between resolution and convenience.
40///
41///  2) The result, which is in radians, operates in the following sense:
42///
43///        Greenwich apparent ST = GMST + equation of the equinoxes
44///
45///  3) The result is compatible with the IAU 2000 resolutions except
46///     that accuracy has been compromised (1 mas) for the sake of speed.
47///     For further details, see McCarthy & Luzum (2003), IERS
48///     Conventions 2003 and Capitaine et al. (2003).
49///
50///  Called:
51///  ```
52///     iauPr00      IAU 2000 precession adjustments
53///     iauObl80     mean obliquity, IAU 1980
54///     iauNut00b    nutation, IAU 2000B
55///     iauEe00      equation of the equinoxes, IAU 2000
56///  ```
57///  References:
58///
59///     Capitaine, N., Wallace, P.T. and McCarthy, D.D., "Expressions to
60///     implement the IAU 2000 definition of UT1", Astronomy &
61///     Astrophysics, 406, 1135-1149 (2003)
62///
63///     McCarthy, D.D. & Luzum, B.J., "An abridged model of the
64///     precession-nutation of the celestial pole", Celestial Mechanics &
65///     Dynamical Astronomy, 85, 37-49 (2003)
66///
67///     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
68///     IERS Technical Note No. 32, BKG (2004)
69pub fn ee00b(date1: f64, date2: f64) -> f64 {
70    let (_, depspr) = pr00(date1, date2);
71
72    // Mean obliquity, consistent with IAU 2000 precession-nutation.
73    let epsa = obl80(date1, date2) + depspr;
74
75    // Nutation in longitude.
76    let (dpsi, _) = nut00b(date1, date2);
77
78    // Equation of the equinoxes.
79    let ee = ee00(date1, date2, epsa, dpsi);
80
81    ee
82}