1 2 3 4 5 6 7 8 9 10 11 12 13
#[derive(Debug, Clone, Copy, PartialEq)] pub struct Epoch { pub julian_date: f64, } impl Epoch { pub fn from_julian_date(julian_date: f64) -> Self { Self { julian_date } } pub fn days_since_j2000(&self) -> f64 { self.julian_date - 2_451_545.0 } }