haversine-distance
Haversine formula in Javascript. In meters. Nothing more.
Example
Import
const haversine = // or
Usage
const a = latitude: 378136 longitude: 1449631 const b = latitude: 338650 longitude: 1512094 console // 714504.18 (in meters)
Alternative forms such as lat
, lng
and lon
work too, with mixed support:
const a = lat: 378136 lng: 1449631 const b = lat: 338650 lon: 1512094 console // 714504.18 (in meters)
GeoJSON support
const a = 1449631 378136const b = 1512094 33865 console // 714504.18 (in meters)