Function Geodesic.tryFromEllipsoid

Prepare a reusable direct/inverse solver without throwing.

static bool tryFromEllipsoid(
  const Ellipsoid!T ellipsoid,
  out Geodesic result
) pure nothrow @nogc @safe;

Parameters

NameDescription
ellipsoid Valid spherical or oblate ellipsoid with 0 <= f <= 0.01. Its semi-major axis defines the distance unit.
result Receives the prepared solver on success.

Returns

true when the ellipsoid and all derived solver coefficients are finite and supported; otherwise false. A failed attempt leaves result as Geodesic!T.init, even when it was previously valid.

Example

Example preparing a geodesic solver without throwing.

import geodesy;
Geodesic!double solver;
assert(Geodesic!double.tryFromEllipsoid(wgs84!double(), solver));
assert(solver.isValid);