flat-projection
Fast geodesic distance approximations via flat surface projection
The FlatProjection
struct can by used to project geographical
coordinates from WGS84 into a cartesian coordinate system.
In the projected form approximated distance and bearing calculations
can be performed much faster than on a sphere. The precision of these
calculations is very precise for distances up to about 500 km.
Usage
extern crate flat_projection;
use FlatProjection;
Benchmark
$ cargo bench
distance/flat time: [22.727 ns 22.955 ns 23.196 ns]
distance/haversine time: [63.349 ns 64.046 ns 64.787 ns]
distance/vincenty time: [358.10 ns 363.16 ns 369.46 ns]
According to these results the flat surface approximation is about 3x faster than the Haversine formula.
Related
- cheap-ruler – Similar calculations in JavaScripts
- cheap-ruler-cpp – C++ port of cheap-ruler
License
This project is released under the MIT license.