location-math
v0.1.0
Published
A small library for working with Geolocation coordinates
Downloads
3
Readme
location-math
A small javascript library for common calculations with a geolocation.
Usage
Geolocation objects are always expected in the form of {lat: ..., lon: ...} with the latitude and longitude as floats
var locationMath = require('location-math');
distance = locationMath.getDistanceBetween(coords1, coords2);
API
###getDistance(coords1, coords2) Returns the distance between two spherical coordinates in meters
###getBoundingBox(coords, distance) Returns the bounding box for given spherical coordinates and distance in meters
###getCentroid(coordinatesArray) Returns the centroid of a polygon given by the coordinatesArray
License
MIT