1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! Standard astronomical epochs and JD ↔ MJD ↔ TJT conversions.
//!
//! Matches JEOD's epoch definitions in
//! [`models/environment/time/include/`](https://github.com/nasa/jeod/blob/jeod_v5.4.0/models/environment/time/include/)
//! (v5.4.0). The Truncated Julian Time (`TJT = MJD - 40000`) is JEOD's
//! preferred internal time variable because it loses the leading
//! `4.0e4` decimal digits that hurt `f64` precision in long sims.
/// J2000.0 epoch as Julian Date: 2000-01-01 12:00:00 TT.
pub const J2000_TT_JD: f64 = 2_451_545.0;
/// J2000.0 epoch as Modified Julian Date (JD - 2400000.5).
pub const J2000_TT_MJD: f64 = 51_544.5;
/// JEOD Truncated Julian Time offset: TJT = MJD - 40000.
pub const TJT_OFFSET: f64 = 40_000.0;
/// J2000.0 as TJT: MJD 51544.5 - 40000 = 11544.5
pub const J2000_TT_TJT: f64 = 11_544.5;
/// TAI TJT at J2000.0 TT epoch.
/// TT = TAI + 32.184s, so TAI is 32.184s behind TT.
/// 32.184s = 32.184/86400 days = 0.000372500 days
/// TAI TJT = 11544.5 - 0.000372500 = 11544.499627500
pub const J2000_TAI_TJT: f64 = 11_544.499_627_5;
/// Noon 2000-01-01 as TJT (= J2000_TT_TJT = 11544.5).
///
/// The Astronomical Almanac GMST formula uses UT1 days since this epoch
/// as its independent variable: `d_u = JD(UT1) - 2451545.0 = ut1_tjt - 11544.5`.
/// Matches JEOD's documented alternative: `ut1_ptr->trunc_julian_time - 11544.5`
/// (see `time_converter_ut1_gmst.cc:112`).
pub const J2000_NOON_TJT: f64 = 11_544.5;
/// TT - TAI offset in seconds (exact by definition).
pub const TAI_TT_OFFSET: f64 = 32.184;
/// Seconds per day.
pub const SECONDS_PER_DAY: f64 = 86_400.0;
/// Convert MJD to TJT (truncated Julian time).
/// Convert TJT to MJD.
/// Convert TJT to Julian Date.
/// Convert Julian Date to TJT.