Expand description
icao-wgs84
A library for performing geometric calculations on the WGS-84 ellipsoid, see Figure 1.
Figure 1 The WGS-84 Ellipsoid (not to scale) Cmglee, CC BY-SA 4.0, via Wikimedia Commons
WGS-84 has become the de facto standard for satellite navigation since its adoption by the Navstar Global Positioning System (GPS) and the USA making GPS available for civilian use in 1983.
This library uses the WGS-84 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 segment. It is the equivalent of a straight line segment in planar geometry or a great circle arc on the surface of a sphere, see Figure 2.
Figure 2 A geodesic segment (orange) and a great circle arc (blue)
This library uses the correspondence between geodesic segments on an ellipsoid and great-circle arcs on a unit sphere, together with 3D vectors to calculate:
- the length and azimuths of a geodesic segment between two positions;
- the along track and across track distances of a point relative to a geodesic segment;
- and the intersection of two geodesic segments.
See: geodesic algorithms.
§Design
The library is based on Charles Karney’s GeographicLib library.
Like GeographicLib, it models geodesic segments as great circle arcs on
the surface of a unit sphere. However, it also uses vectors to perform
calculations between geodesic segments.
The Ellipsoid class represents an ellipsoid of revolution.
The static WGS84_ELLIPSOID represents the WGS-84 Ellipsoid which is used
by the GeodesicSegment From traits to create GeodesicSegments on the WGS-84 Ellipsoid.
The library depends upon the following crates:
- angle-sc - to define
Angle,DegreesandRadiansand perform trigonometric calculations; - unit-sphere - to define
LatLongand perform great-circle and vector calculations. - icao_units - to define
MetresandNauticalMilesand perform conversions between them.
Figure 3 Class Diagram
The library is declared no_std so it can be used in embedded applications.
Modules§
- ellipsoid
- The ellipsoid module contains types and functions for defining an ellipsoid given its Semimajor axis (the equivalent of its radius) and flattening ratio.
- geodesic
- The geodesic module contains functions for calculating the geodesic segment between two points on the surface of an ellipsoid.
- intersection
- The
intersectionmodule contains functions for calculating geodesic intersections using vectors.
Structs§
- Angle
- An angle represented by it’s sine and cosine as
UnitNegRanges. - Degrees
- The Degrees newtype an f64.
- Ellipsoid
- The parameters of an
Ellipsoid. - Geodesic
Segment - A geodesic segment on the surface of an ellipsoid.
- LatLong
- A position as a latitude and longitude pair of
Degrees. - Metres
- A
Metresnewtypefor representing distance. - Nautical
Miles - A Nautical Mile
newtypefor representing distance. - Radians
- The Radians newtype an f64.
Statics§
- WGS84_
ELLIPSOID - A static instance of the WGS-84
Ellipsoid.
Traits§
- Validate
- The Validate trait.
Functions§
- calculate_
azimuths_ and_ geodesic_ length - Calculate the azimuths and geodesic length (in metres) between a pair of positions on the ellipsoid.
- calculate_
intersection_ distances - Calculate the distances along a pair of
GeodesicSegments (in Radians) to their closest intersection or reference points. - calculate_
intersection_ point - Calculate the position (Latitude and Longitude) where a pair of
GeodesicSegments intersect, or None if theGeodesicSegments do not intersect.