Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

turf-distance

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turf-distance - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

.travis.yml

3

index.js
//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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc