Struct GeocentricCoordinate
A geocentric Cartesian coordinate (x, y, z).
struct GeocentricCoordinate(T)
if (isGeodesyScalar!T);
The type does not encode a CRS, datum, ellipsoid, or linear unit. All three components use one caller-selected linear unit; when combined with an ellipsoid, its axes must use that same unit.
is the representable geocentre (0,0,0). Whether an operation is
mathematically defined there is the responsibility of that operation.
Checked construction rejects non-finite components without throwing;
throwing construction uses GeodesyValueException.
Properties
| Name | Type | Description |
|---|---|---|
x[get]
|
T | Geocentric X component. |
y[get]
|
T | Geocentric Y component. |
z[get]
|
T | Geocentric Z component. |
Methods
| Name | Description |
|---|---|
fromComponents
(x, y, z)
|
Construct from finite X/Y/Z components. |
tryFromComponents
(x, y, z, result)
|
Construct from finite X/Y/Z components without throwing. |
Example
Example constructing a geocentric coordinate.
import geodesy;
const p = GeocentricCoordinate!double .fromComponents(
4_085_000.0, 1_260_000.0, 4_717_000.0);
assert(p .x == 4_085_000.0);
assert(p .y == 1_260_000.0);
assert(p .z == 4_717_000.0);