rhumbDistance
Description
Calculates the distance along a rhumb line between two points in degrees, radians, miles, or kilometers.
Parameters
Name | Type | Description |
---|---|---|
from | Coord | origin point |
to | Coord | destination point |
options? | Object | Optional parameters (default {}) |
options.units? | string | can be degrees, radians, miles, or kilometers (default "kilometers") |
Returns
number distance between the two points
Examples
var from = turf.point([-75.343, 39.984]);
var to = turf.point([-75.534, 39.123]);
var options = { units: "miles" };
var distance = turf.rhumbDistance(from, to, options);
Installation
$ npm install @turf/rhumb-distance
import { rhumbDistance } from "@turf/rhumb-distance";
const result = rhumbDistance(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.rhumbDistance(...);