turf-distance
Advanced tools
Comparing version 0.1.1 to 0.1.2
//http://en.wikipedia.org/wiki/Haversine_formula | ||
//http://www.movable-type.co.uk/scripts/latlong.html | ||
// expects a feature collection of points | ||
@@ -38,2 +37,2 @@ module.exports = function(point1, point2, units){ | ||
return degree * Math.PI / 180 | ||
} | ||
} |
{ | ||
"name": "turf-distance", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "turf distance module", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
turf-distance | ||
============= | ||
[![Build Status](https://travis-ci.org/Turfjs/turf-distance.svg?branch=master)](https://travis-ci.org/Turfjs/turf-distance) | ||
Calculates the distance between two point features in degrees, radians, miles, or kilometers. This uses the haversine formula to account for global curvature. | ||
```javascript | ||
var distance = require('turf-distance') | ||
var point = require('turf-point') | ||
var point1 = point(-75.343, 39.984) | ||
var point2 = point(-75.534, 39.123) | ||
var unit = 'miles' // or 'kilometers', 'degrees', 'radians' | ||
var distanced = distance(point1, point2, unit) | ||
console.log(distanced) | ||
``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4207
7
18