Skip to main content

siderust/coordinates/transform/providers/
frames_teme.rs

1// SPDX-License-Identifier: AGPL-3.0-only
2// Copyright (C) 2026 Vallés Puig, Ramon
3
4//! Frame-rotation provider for **TEME** (True Equator Mean Equinox).
5//!
6//! TEME is the output frame of SGP4/SDP4 propagators used with TLE data.
7//! It shares the true equator of date but uses a simplified equinox
8//! definition (the "equation of the equinoxes" shortcut).
9//!
10//! The rotation chain is:
11//!
12//! ```text
13//! TEME → EquatorialTrueOfDate → (precession/nutation) → ICRS
14//! ```
15//!
16//! The first step is Rz(Δψ cos εA), which removes the approximate
17//! equinox offset.
18
19use super::*;
20
21impl FrameRotationProvider<TEME, EquatorialTrueOfDate> for () {
22    #[inline]
23    fn rotation<Eph, Eop: EopProvider, Nut: NutationModel>(
24        jd: JulianDate,
25        _ctx: &AstroContext<Eph, Eop>,
26    ) -> Rotation3 {
27        let nut = Nut::nutation(jd);
28        Rotation3::rz(nut.dpsi * nut.mean_obliquity.cos())
29    }
30}
31
32impl FrameRotationProvider<EquatorialTrueOfDate, TEME> for () {
33    #[inline]
34    fn rotation<Eph, Eop: EopProvider, Nut: NutationModel>(
35        jd: JulianDate,
36        ctx: &AstroContext<Eph, Eop>,
37    ) -> Rotation3 {
38        inverse_rotation::<EquatorialTrueOfDate, TEME, Eph, Eop, Nut>(jd, ctx)
39    }
40}
41
42impl FrameRotationProvider<TEME, ICRS> for () {
43    #[inline]
44    fn rotation<Eph, Eop: EopProvider, Nut: NutationModel>(
45        jd: JulianDate,
46        ctx: &AstroContext<Eph, Eop>,
47    ) -> Rotation3 {
48        compose_rotation::<TEME, EquatorialTrueOfDate, ICRS, Eph, Eop, Nut>(jd, ctx)
49    }
50}
51
52impl FrameRotationProvider<ICRS, TEME> for () {
53    #[inline]
54    fn rotation<Eph, Eop: EopProvider, Nut: NutationModel>(
55        jd: JulianDate,
56        ctx: &AstroContext<Eph, Eop>,
57    ) -> Rotation3 {
58        inverse_rotation::<ICRS, TEME, Eph, Eop, Nut>(jd, ctx)
59    }
60}