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
| Name | Type | Description |
|---|---|---|
distance[get]
|
T | Shortest geodesic distance in the same linear unit as the ellipsoid semi-major axis. |
finalAzimuth[get]
|
Angle!T | Direction of travel on reaching the endpoint, as an Angle.
|
initialAzimuth[get]
|
Angle!T | Direction 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);