Function GeodesicLine.tryPositionUnrolled

Find a position by distance without wrapping longitude at 180 degrees.

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

Use this when a path crosses the antimeridian or makes full turns and you need its accumulated longitude change. The result provides unrolledLongitude as an Angle, not a bounded Longitude.

Example

Example retaining longitude continuity for a distance position.

const sphere = Ellipsoid!double.sphere(1.0);
const solver = Geodesic!double.fromEllipsoid(sphere);
const start = GeographicCoordinate!double.fromComponents(
    Latitude!double.fromDegrees(0.0),
    Longitude!double.fromDegrees(10.0));
const line = GeodesicLine!double.fromGeodesic(
    solver, start, Angle!double.fromDegrees(90.0));
GeodesicLineUnrolledResult!double result;
assert(line.tryPositionUnrolled(
    2.0 * PI + PI / 2.0,
    result));
assert(result.unrolledLongitude.degrees > 459.999999);