The package contains a port for Dart language of ellipsoidal geodesy tools
(more spefically Vincenty solutions of geodesics on the ellipsoid),
originally written in JavaScript by Chris Veness. See the online form on the
Movable Type Scripts
web site and source
code
on GitHub.
These functions are based on an ellipsoidal earth model using
direct and inverse solutions of geodesics on the ellipsoid devised by
Thaddeus Vincenty.
Functions available:
inverse Vincenty calculations
input: origin and destination geographic positions
output: initial and final bearings in degrees, and distance in meters between input positions along the shortest geodetic arc (geodesic) on the ellipsoid surface
direct Vincenty calculations
input: an origin geographic position, an initial bearing and a distance in meters to a destination point
output: a destination geographic position and a final bearing
shortcuts to calculate just distance or bearings using inverse functions
shortcuts to calculate midpoints and intermediate points (with bearings that varies along the geodesic) between origin and destination geographic positions
The accuracy of distances calculated is approximately within 0.5 mm and
bearings within 0.000015″. However even if this sound quite accurate, normally
source positions (measured by GPS handheld devices etc.) is not within that
accuracy but rather within meter scale tolerances. So it’s important to evaluate
also the accuracy of source positions, not only the quality of calculations.
Anyway using these ellipsoidal functions should yield better results than using
similar methods on spherical geodesy
functions, that are also available on this library.
The package also provides methods to transform between ellipsoidal position representations
geographic positions (latitude and longitude as geodetic coordinates)
🌐 Vincenty ellipsoidal calculations
Distances & bearings between points, and destination points calculated on an
ellipsoidal earth model, along geodesics on the surface of a reference ellipsoid
selected:
There are also methods to calculate mid points and intermediate points along the
geodesic.
The package provides Ellipsoid.WGS84 and Ellipsoid.GRS80 ellipsoids as
constant value objects. These ellipsoids should be enough for most modern
geodetic calculations:
However if an older ellipsoid is needed it’s possible to define such manually
using known ellipsoidal parameters. The following sample defines the Airy 1830
ellipoid and compares distance calculated along geodesics of each ellipsoid
surfaces:
🗺️ Transform between geographic and geocentric coordinates
This sample shows how to transform coordinate values between geographic
positions (latitude and longitude as geodetic coordinates) and
geocentric cartesian coordinates represented by
ECEF (earth-centric earth-fixed) positions:
Samples above used the WGS84 reference ellipsoid for ellipsoidal calculations.
You can also use other ellipsoids on toGeocentricCartesian and
fromGeocentricCartesian methods: