Struct GeodesicInverseResult

Shortest surface distance and travel directions between two positions.

struct GeodesicInverseResult(T)
  
if (isGeodesyScalar!T);

Read distance for the shortest surface distance in the ellipsoid's linear unit (metres with WGS 84). initialAzimuth is the direction to leave the start point. finalAzimuth is the direction of travel when reaching the end, not the bearing back toward the start.

Both azimuths are canonicalized from -pi inclusive to +pi exclusive. Coincident endpoints have the unique canonical result distance +0, initial azimuth +0, final azimuth +0.

Properties

NameTypeDescription
distance[get] TShortest geodesic distance in the same linear unit as the ellipsoid semi-major axis.
finalAzimuth[get] Angle!TDirection of travel on reaching the endpoint, as an Angle.
initialAzimuth[get] Angle!TDirection of travel when leaving the start, as an Angle.

Example

Example using an inverse geodesic result.

import geodesy;
const solver = Geodesic!double.fromEllipsoid(wgs84!double());
const vienna = GeographicCoordinate!double.fromComponents(
    Latitude!double.fromDegrees(48.20849),
    Longitude!double.fromDegrees(16.37208));
const graz = GeographicCoordinate!double.fromComponents(
    Latitude!double.fromDegrees(47.07071),
    Longitude!double.fromDegrees(15.43950));
const result = solver.inverse(vienna, graz);
assert(result.distance > 0.0);