Struct Epoch

Finite geodetic epoch represented as a decimal year.

struct Epoch(T)
  
if (isGeodesyScalar!T);

The value is intentionally only a numerical epoch coordinate. Calendar and time-scale conversion belong outside this type.

Properties

NameTypeDescription
decimalYear[get] TDecimal-year representation.
isValid[get] boolWhether this value contains a valid finite epoch.

Methods

NameDescription
fromDecimalYear (value) Construct a finite decimal-year epoch.
tryFromDecimalYear (value, result) Construct a finite decimal-year epoch without throwing.

Example

Example constructing and comparing epochs.

import geodesy;

const reference = Epoch!double.fromDecimalYear(2010.0);
const observation = Epoch!double.fromDecimalYear(2025.25);

assert(reference.isValid);
assert(observation.decimalYear == 2025.25);
assert(!Epoch!double.init.isValid);