Function Rhumb.tryInverse

Find distance and constant bearing between two positions without throwing.

bool tryInverse(
  const GeographicCoordinate!T start,
  const GeographicCoordinate!T end,
  out RhumbInverseResult!T result
) const pure nothrow @nogc @safe;

Use this when you want a constant-heading route and need to handle failure without exceptions. The result contains the rhumb distance in the ellipsoid's linear unit and the constant bearing.

Example

Example solving an inverse rhumb without throwing.

import geodesy;
const solver = Rhumb!double.fromEllipsoid(wgs84!double());
const start = GeographicCoordinate!double.fromComponents(
    Latitude!double.fromDegrees(48.20849),
    Longitude!double.fromDegrees(16.37208));
const end = GeographicCoordinate!double.fromComponents(
    Latitude!double.fromDegrees(47.07071),
    Longitude!double.fromDegrees(15.43950));
RhumbInverseResult!double result;
assert(solver.tryInverse(start, end, result));
assert(result.distance > 0.0);