Function PolarStereographic.tryReverse

Convert polar-grid easting and northing back to latitude and longitude.

bool tryReverse(
  const ProjectedCoordinate!T source,
  out GeographicCoordinate!T result
) const pure nothrow @nogc @safe;

This checked form returns false when the input is outside the supported projection rather than throwing an exception.

Example

Example checking a Polar Stereographic reverse projection.

import geodesy;
const projection = PolarStereographic!double.fromParameters(
    wgs84!double(), Latitude!double.fromDegrees(90.0),
    Longitude!double.fromDegrees(0.0), 0.994,
    2_000_000.0, 2_000_000.0);
GeographicCoordinate!double result;
assert(projection.tryReverse(
    ProjectedCoordinate!double.fromComponents(
        3_320_416.74736, 632_668.43127), result));
assert(result.latitude.degrees > 72.9);