distance-calculator-radians
v0.0.4
Published
This is a distance calculator expecting two obj, one is point from which you want to calculate distance and other is target, upto which you want to calculate distance. Each obj expects two keys 'latitude' and 'longitude', which can be parse as a string or
Downloads
4
Readme
Distance Calculator Radians
This is a distance calculator library which is expecting two obj, one is point from which you want to calculate distance and other is target, upto which you want to calculate distance. Each obj expects two keys 'latitude' and 'longitude', which can be parse as a string or number. It will return you the distance between these two points.
Note: Distance is calculated in kilometers.
Installation
Use the package manager npm to install distance-calculator-radians.
npm install distance-calculator-radians
Usage
var distanceObj = require('distance-calculator-radians');
const pointObj = {
latitude: 'point latitude',
longitude: 'point longitude'
}
const targetObj = {
latitude: 'target latitude',
longitude: 'target longitude'
}
let distance = distanceObj.distanceCalculator(pointObj, targetObj);