LatLong - Lightweight library for common latitude and longitude calculation
This library supports both, the "Haversine" and the "Vincenty" algorithm.
"Haversine" is a bit faster but "Vincenty" is far more accurate!
Catmull-Rom algorithm is used for smoothing out the path.
Basic usage
Distance
; // km = 423 ; // meter = 422591.551 ;
Offset
; ; ; ; // LatLng(latitude:-45.219848, longitude:0.0) console.logp2.round; // 45° 13' 11.45" S, 0° 0' 0.00" O console.logp2.toSexagesimal;
Path smoothing
// zigzag is a list of coordinates ; // Result is below ;
For more - check out my tests