1.0.1 • Published 5 years ago

lat-long-distance v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
5 years ago

This module calculates distance (in Km) between 2 points identified by their latitude and longitude, respectively

Include the module in your project by using the following npm command

npm install --save lat-long-distance

To use in the project , require it in your project

####nodejs Following code demonstrates how to use it to find distance between 2 points

// Include the module in the project
const latLongDistance = require('lat-long-distance');
// Instantiate a new object
const converter = new latLongDistance();
// Set the source point
converter.setPoint('from', {latitude : 123, longitude : 123});
// Set the destination point
converter.setPoint('to', {latitude : 123, longitude : 123});
// Invoke `distanceInKm` function to get the distance in km between source and destination points
let distance = converter.distanceInKm();

#####Thank you! Enjoy