use super::earth_eo_ee::{earth_ee, earth_eo};
use super::{Sidereal, wrap_angle};
use crate::Real;
impl Sidereal {
#[inline]
pub const fn era(ut1_mjd: Real) -> Real {
Self::EARTH.rotation_angle(ut1_mjd)
}
#[inline]
pub const fn eo(tt_mjd: Real) -> Real {
earth_eo(2_400_000.5, tt_mjd)
}
#[inline]
pub const fn ee(tt_mjd: Real) -> Real {
earth_ee(2_400_000.5, tt_mjd)
}
#[inline]
pub const fn gmst(ut1_mjd: Real, tt_mjd: Real) -> Real {
wrap_angle(Self::era(ut1_mjd) - Self::eo(tt_mjd) - Self::ee(tt_mjd))
}
#[inline]
pub const fn gast(ut1_mjd: Real, tt_mjd: Real) -> Real {
wrap_angle(Self::era(ut1_mjd) - Self::eo(tt_mjd))
}
#[inline]
pub const fn lmst(&self, ut1_mjd: Real, tt_mjd: Real) -> Real {
wrap_angle(Self::gmst(ut1_mjd, tt_mjd) + self.longitude_rad)
}
#[inline]
pub const fn last(&self, ut1_mjd: Real, tt_mjd: Real) -> Real {
wrap_angle(Self::gast(ut1_mjd, tt_mjd) + self.longitude_rad)
}
}