Expand description
icao-wgs84
A library for performing geometric calculations on the WGS84 ellipsoid, see Figure 1.
Figure 1 The WGS84 Ellipsoid (not to scale)
WGS84 has become the de facto standard for satellite navigation since its adoption by the Navstar Global Positioning System (GPS) and US president Ronald Reagan’s 1983 decision to make GPS available for civilian use after airliner KAL 007 was shot down by Soviet interceptor aircraft when it strayed into prohibited airspace due to navigational errors.
This library uses the WGS84 primary parameters defined in Tab. 3-1 of the ICAO WGS 84 Implementation Manual.
§Geodesic navigation
The shortest path between two points on the surface of an ellipsoid is a geodesic - the equivalent of straight line segments in planar geometry or great circles on the surface of a sphere, see Figure 2.
Figure 2 A geodesic between points A and B
This library uses the correspondence between geodesics on an ellipsoid and great-circles on the auxiliary sphere together with 3D vectors to calculate:
- the initial azimuth and length of a geodesic between two positions;
- the along track distance and across track distance of a position relative to a geodesic;
- and the intersection of a pair of geodesics.
§Design
The library is based on Charles Karney’s GeographicLib library.
Like GeographicLib
, it models geodesic paths as great circles on
the surface of an auxiliary sphere. However, it also uses vectors to
calculate along track distances, across track distances and
intersections between geodesics.
The Ellipsoid
class represents an ellipsoid of revolution.
The static WGS84_ELLIPSOID
represents the WGS 84 Ellipsoid
which is used
by the Geodesic
From
traits to create Geodesic
s on the WGS 84 Ellipsoid
.
The library depends upon the following crates:
- angle-sc - to define
Angle
,Degrees
andRadians
and perform trigonometric calculations; - unit-sphere - to define
LatLong
and perform great-circle and vector calculations. - icao_units - to define
Metres
andNauticalMiles
and perform conversions between them.
The library is declared no_std so it can be used in embedded applications.
Modules§
- The ellipsoid module contains types and functions for defining an ellipsoid given its Semimajor axis (the equivalent of its radius) and flattening ratio.
- The geodesic module contains functions for calculating the geodesic path between two points on the surface of an ellipsoid.
- The
intersection
module contains functions for calculating geodesic intersections using vectors.
Structs§
- An angle represented by it’s sine and cosine as
UnitNegRanges
. - The Degrees newtype an f64.
- The parameters of an
Ellipsoid
. - A geodesic path on the surface of an ellipsoid.
- A position as a latitude and longitude pair of
Degrees
. - A
Metres
newtype
for representing distance. - A Nautical Mile
newtype
for representing distance. - The Radians newtype an f64.
Traits§
- The Validate trait.
Functions§
- Calculate the azimuth and geodesic length (in metres) between a pair of positions on the ellipsoid.
- Calculate the distances along a pair of Geodesics (in Radians) to their closest intersection or reference points.
- Calculate the position (Latitude and Longitude) where a pair of
Geodesic
s intersect, or None if theGeodesic
s do not intersect.