pub struct TCG(/* private fields */);Expand description
Geocentric Coordinate Time.
Wraps a JulianDate representing an instant in the TCG time scale.
TCG is the coordinate time for the Geocentric Celestial Reference System,
running ~6.97e-10 faster than TT (about 22 microseconds per year).
Implementations§
Source§impl TCG
impl TCG
Sourcepub fn new(seconds: i64, nanos: u32) -> Self
pub fn new(seconds: i64, nanos: u32) -> Self
Creates a TCG instant from Unix timestamp components.
Converts seconds and nanoseconds since 1970-01-01 00:00:00 to TCG. Note: This assumes the Unix timestamp is already in the TCG scale.
Sourcepub fn from_julian_date(jd: JulianDate) -> Self
pub fn from_julian_date(jd: JulianDate) -> Self
Creates a TCG instant from a Julian Date.
Sourcepub fn to_julian_date(&self) -> JulianDate
pub fn to_julian_date(&self) -> JulianDate
Returns the underlying Julian Date.
Sourcepub fn add_seconds(&self, seconds: f64) -> Self
pub fn add_seconds(&self, seconds: f64) -> Self
Adds seconds to this TCG instant, returning a new TCG.
Trait Implementations§
Source§impl From<JulianDate> for TCG
Conversion from JulianDate to TCG.
impl From<JulianDate> for TCG
Conversion from JulianDate to TCG.
Source§fn from(jd: JulianDate) -> Self
fn from(jd: JulianDate) -> Self
Source§impl FromStr for TCG
Parses ISO 8601 formatted strings into TCG.
impl FromStr for TCG
Parses ISO 8601 formatted strings into TCG.
Accepts standard date-time formats like “2000-01-01T12:00:00”. Fractional seconds are supported.
Source§impl ToTAI for TCG
Convert TCG to TAI by chaining through TT.
impl ToTAI for TCG
Convert TCG to TAI by chaining through TT.
TCG has no direct conversion to TAI. This chains: TCG → TT → TAI.
Source§fn to_tai(&self) -> TimeResult<TAI>
fn to_tai(&self) -> TimeResult<TAI>
Source§impl ToTCB for TCG
impl ToTCB for TCG
Source§fn to_tcb(&self) -> TimeResult<TCB>
fn to_tcb(&self) -> TimeResult<TCB>
Convert TCG to TCB by applying the L_B rate correction.
Uses L_B / (1 - L_B) as the rate ratio for the forward transformation.
This ratio accounts for the fact that we’re computing TCB from TCG, not vice versa.
The correction is computed relative to the 1977 reference epoch where TCG = TCB. Applies the correction to the smaller-magnitude JD component for precision.
Source§impl ToTCG for TCG
impl ToTCG for TCG
Source§fn to_tcg(&self) -> TimeResult<TCG>
fn to_tcg(&self) -> TimeResult<TCG>
Identity conversion. Returns self unchanged.
Source§impl ToTT for TCG
impl ToTT for TCG
Source§fn to_tt(&self) -> TimeResult<TT>
fn to_tt(&self) -> TimeResult<TT>
Convert TCG to TT by removing the L_G rate correction.
Computes: TT = TCG - L_G * (JD_TCG - T0) * 86400 / 86400
The correction is subtracted because TCG runs faster than TT. At J2000.0, this removes about 0.506 seconds.