0.1.0 • Published 10 years ago

location-math v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

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