GeodesicLine.tryPosition - multiple declarations

Function GeodesicLine.tryPosition

Find a position at a chosen distance along the prepared geodesic.

bool tryPosition(
  const T distance,
  out GeodesicDirectResult!T result
) const pure nothrow @nogc @safe;

Pass a distance in the ellipsoid's linear unit. A negative distance follows the same path backward. The result contains the position and forward heading there; this checked form returns false on failure.

Example

Example evaluating a prepared line without throwing.

const solver = Geodesic!double.fromEllipsoid(
    Ellipsoid!double.fromFlattening(
        6_378_137.0,
        1.0 / 298.257223563));
const start = GeographicCoordinate!double.fromComponents(
    Latitude!double.fromDegrees(48.20849),
    Longitude!double.fromDegrees(16.37208));
const line = GeodesicLine!double.fromGeodesic(
    solver, start, Angle!double.fromDegrees(73.0));
GeodesicDirectResult!double result;
assert(line.tryPosition(1_000.0, result));

Function GeodesicLine.tryPosition

Evaluate a signed distance together with advanced segment quantities.

bool tryPosition(
  const T distance,
  out GeodesicDirectResult!T result,
  out GeodesicQuantities!T quantities
) const pure nothrow @nogc @safe;

This overload computes m12, M12, M21, and S12 on demand without enlarging the prepared line or changing the ordinary distance hot path.