README
jeyo-distans
Get distance between two geographic coordinates
Getting Started
From browsers and node.
jeyo-distans use the umd implementation to be usable from anywhere (client, server, ...).
Install the module with: npm install jeyo-distans
Use it with: jeyoDistans = require( "jeyo-distans" );
Documentation
The jeyo-distans module exposts an unique function :
jeyoDistans( positionOne, positionTwo )
positionOne
positionTwo
The two arguments represents geographic coordinates formated as :
- an
Array
, where the first member is aNumber
representing the latitude of the position, and the second member is aNumber
representing the longitude Of the position. - an
Object
, where thelatitude
orlat
property is aNumber
representing the latitude of the position, and thelongitude
orlng
property is aNumber
representing the longitude of the position.
Te returns value is a Number
, representing the distance between the two positions, in kilometers (with 3
decimal numbers).
Examples
See tests.
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.
Release History
- 0.1.0: Initial release (08/06/14)
- 0.2.0: Initial release (10/06/14)
TODO
- Choose returns unit
License
Copyright (c) 2014 Leny
Licensed under the MIT license.