https://github.com/sahlhoff/afar
Calculate the distance (km) between two latitude and longitude points.
https://github.com/sahlhoff/afar
distance latitude longitude-points
Last synced: 11 months ago
JSON representation
Calculate the distance (km) between two latitude and longitude points.
- Host: GitHub
- URL: https://github.com/sahlhoff/afar
- Owner: sahlhoff
- Created: 2016-07-08T02:07:10.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2024-03-12T15:11:51.000Z (about 2 years ago)
- Last Synced: 2025-06-08T20:52:36.947Z (12 months ago)
- Topics: distance, latitude, longitude-points
- Language: JavaScript
- Size: 1.95 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Afar
Calculate the distance (km) between two latitude and longitude points.
## Install
~~~bash
npm i afar
~~~
## Usage
~~~js
var afar = require('afar')
// SF lat/lon
var lat1 = '37.7749';
var lon1 = '122.4194';
// LA lat/lon
var lat2 = '34.0522';
var lon2 = '118.2437';
afar(lat1, lon1, lat2, lon2)
// => 559.1205770615537
~~~