DeltaT

Struct DeltaT 

Source
pub struct DeltaT;
Expand description

Utilities for estimating ΔT (Delta T) values.

ΔT represents the difference between Terrestrial Time (TT) and Universal Time (UT1). These estimates are based on Espenak and Meeus polynomial fits updated in 2014.

Implementations§

Source§

impl DeltaT

Source

pub fn estimate(decimal_year: f64) -> Result<f64>

Estimates ΔT for a given decimal year.

Based on polynomial fits from Espenak & Meeus, updated 2014. See: https://www.eclipsewise.com/help/deltatpoly2014.html

§Arguments
  • decimal_year - Year with fractional part (e.g., 2024.5 for mid-2024)
§Returns

Estimated ΔT in seconds

§Errors

Returns error for years outside the valid range (-500 to 3000 CE)

§Example
let delta_t = DeltaT::estimate(2024.0).unwrap();
assert!(delta_t > 60.0 && delta_t < 80.0); // Reasonable range for 2024
Source

pub fn estimate_from_date(year: i32, month: u32) -> Result<f64>

Estimates ΔT from year and month.

Calculates decimal year as: year + (month - 0.5) / 12

§Arguments
  • year - Year
  • month - Month (1-12)
§Returns

Estimated ΔT in seconds

§Errors

Returns error if month is outside the range 1-12.

Auto Trait Implementations§

§

impl Freeze for DeltaT

§

impl RefUnwindSafe for DeltaT

§

impl Send for DeltaT

§

impl Sync for DeltaT

§

impl Unpin for DeltaT

§

impl UnwindSafe for DeltaT

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.