1.0.1 • Published 11 years ago
turf-vincenty-inverse v1.0.1
turf-vincenty-inverse
turf distance module
turf.vincenty-inverse(from, to, units)
Vincenty's inverse formula computes the geographical distance and direction between two given points.
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.vincenty-inverse(point1, point2, units);
//=distanceReturns Number, distance between the two points
Installation
Requires nodejs.
$ npm install turf-vincenty-inverseTests
$ npm test1.0.1
11 years ago