Function GeocentricCoordinate.fromComponents

Make an Earth-centred XYZ position from three distances.

static GeocentricCoordinate fromComponents(
  const T x,
  const T y,
  const T z
) @safe;

Use this form when invalid data should raise an exception. Use tryFromComponents when the caller needs to handle invalid input without throwing.

Parameters

NameDescription
x Finite geocentric X component.
y Finite geocentric Y component.
z Finite geocentric Z component.

Returns

The constructed coordinate.

Throws

GeodesyValueException when any component is NaN or infinite.

Example

Example constructing an ECEF coordinate.

import geodesy;
const point = GeocentricCoordinate!double.fromComponents(
    4_085_000.0, 1_260_000.0, 4_717_000.0);
assert(point.z == 4_717_000.0);
}

/** Geocentric X component. */
@property T x() const pure nothrow @safe @nogc { return _x;