pub trait TimeZone {
// Required methods
fn millis(&self) -> f64;
fn offset(&self) -> f64;
fn julian_offset(&self) -> f64;
fn julian_date_universal_time(&self) -> f64;
fn body_host_ratio(&self) -> f64;
fn julian_date_terrestial_time(&self) -> f64;
fn julian_date_2000_time(&self) -> f64;
fn day_date(&self) -> f64;
fn fractional_hour(&self) -> f64;
fn fractional_minute(&self) -> f64;
fn coordinated_time(&self) -> f64;
fn now(&self) -> Time;
}Expand description
This trait acts as a common field for all all planets, asteroids, moons, exo-planets, and comets.
The timezone is implemented for specific timezones because each timezone has specific calculations to generate a time from UTC.
Required Methods§
Sourcefn julian_offset(&self) -> f64
fn julian_offset(&self) -> f64
This method calculates the julian day offset from the coordinated time offset
Sourcefn julian_date_universal_time(&self) -> f64
fn julian_date_universal_time(&self) -> f64
This method gets the jd_ut of the timezone
Sourcefn body_host_ratio(&self) -> f64
fn body_host_ratio(&self) -> f64
This method calculates (body / host) rotational periods
Body Earth Ratio
- body_rotational_period / earth_rotational_period
Body Moon Ratio
- moon_rotational_period / body_rotational_period (host planet of the exact moon)
Sourcefn julian_date_terrestial_time(&self) -> f64
fn julian_date_terrestial_time(&self) -> f64
This method gets the jd_tt of the timezone
Sourcefn julian_date_2000_time(&self) -> f64
fn julian_date_2000_time(&self) -> f64
This method gets the jd2000 time
Sourcefn fractional_hour(&self) -> f64
fn fractional_hour(&self) -> f64
This method is the fractional hour that splits the day_date to hours
Sourcefn fractional_minute(&self) -> f64
fn fractional_minute(&self) -> f64
This method is the fractional hour that splits the day_date to minutes
Sourcefn coordinated_time(&self) -> f64
fn coordinated_time(&self) -> f64
This method gets the coordinated time