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
| Name | Type | Description |
|---|---|---|
decimalYear[get]
|
T | Decimal-year representation. |
isValid[get]
|
bool | Whether this value contains a valid finite epoch. |
Methods
| Name | Description |
|---|---|
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);