Skip to content

Vincenty's inverse formula computes the geographical distance and direction between two given points.

License

Notifications You must be signed in to change notification settings

Turfjs/turf-vincenty-inverse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

turf-vincenty-inverse

build status

turf vincenty inverse module

turf.vincenty-inverse(from, to, [units=kilometers])

Calculates the distance between two Point|points in degress, radians, miles, or kilometers. This uses the Vincenty's Formulae to account for global curvature.

Parameters

parameter type description
from Feature.<Point> origin point
to Feature.<Point> destination point
[units=kilometers] String optional: can be degrees, radians, miles, or kilometers

Example

var point1 = {
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "Point",
    "coordinates": [-75.343, 39.984]
  }
};
var point2 = {
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "Point",
    "coordinates": [-75.534, 39.123]
  }
};
var units = "miles";

var points = {
  "type": "FeatureCollection",
  "features": [point1, point2]
};

//=points

var distance = turf.distance(point1, point2, units);

//=distance

Returns Number, distance between the two points

Installation

Requires nodejs.

$ npm install turf-vincenty-inverse

Tests

$ npm test

About

Vincenty's inverse formula computes the geographical distance and direction between two given points.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published