Skip to main content

TCB

Struct TCB 

Source
pub struct TCB(/* private fields */);
Expand description

Barycentric Coordinate Time.

Wraps a Julian Date interpreted in the TCB time scale. TCB is the proper time for a clock at the solar system barycenter, far from gravitational sources.

Implementations§

Source§

impl TCB

Source

pub fn new(seconds: i64, nanos: u32) -> Self

Creates TCB from Unix timestamp components.

Interprets the given seconds and nanoseconds as elapsed since Unix epoch (1970-01-01T00:00:00) in the TCB scale.

Source

pub fn from_julian_date(jd: JulianDate) -> Self

Creates TCB from a Julian Date.

Source

pub fn j2000() -> Self

Returns TCB at the J2000.0 epoch (2000-01-01T12:00:00).

Source

pub fn to_julian_date(&self) -> JulianDate

Returns the underlying Julian Date.

Source

pub fn add_seconds(&self, seconds: f64) -> Self

Returns a new TCB advanced by the given seconds.

Source

pub fn add_days(&self, days: f64) -> Self

Returns a new TCB advanced by the given days.

Trait Implementations§

Source§

impl Clone for TCB

Source§

fn clone(&self) -> TCB

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TCB

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for TCB

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats as “TCB <julian_date>”.

Source§

impl From<JulianDate> for TCB

Source§

fn from(jd: JulianDate) -> Self

Converts a Julian Date to TCB.

Source§

impl FromStr for TCB

Source§

fn from_str(s: &str) -> TimeResult<Self>

Parses an ISO 8601 datetime string as TCB.

Accepts formats like “2000-01-01T12:00:00” or “2000-01-01T12:00:00.123”.

Source§

type Err = TimeError

The associated error which can be returned from parsing.
Source§

impl PartialEq for TCB

Source§

fn eq(&self, other: &TCB) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl TcbToTdb for TCB

Source§

fn tcb_to_tdb(&self) -> TimeResult<TDB>

Convert TCB to TDB by removing the L_B rate correction.

The correction is computed as: L_B * (TCB - T0) where T0 is the 1977 epoch. The TDB_0 offset is added to align with TT at the geocenter.

Applies the correction to the smaller-magnitude JD component for precision.

Source§

impl ToTCB for TCB

Source§

fn to_tcb(&self) -> TimeResult<TCB>

Identity conversion. Returns self unchanged.

Source§

impl ToTCGFromTCB for TCB

Source§

fn to_tcg(&self) -> TimeResult<TCG>

Convert TCB to TCG by removing the L_B rate correction.

Computes: TCG = TCB - L_B * (JD_TCB - T0)

The correction is subtracted because TCB runs faster than TCG. At J2000.0, this removes about 11.25 seconds.

Applies the correction to the smaller-magnitude JD component for precision.

Source§

impl Copy for TCB

Source§

impl StructuralPartialEq for TCB

Auto Trait Implementations§

§

impl Freeze for TCB

§

impl RefUnwindSafe for TCB

§

impl Send for TCB

§

impl Sync for TCB

§

impl Unpin for TCB

§

impl UnsafeUnpin for TCB

§

impl UnwindSafe for TCB

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.