Skip to main content
Version: Next

rhumbDistance

Description

Calculates the distance along a rhumb line between two points in degrees, radians, miles, or kilometers.

Parameters

NameTypeDescription
fromCoordorigin point
toCoorddestination point
options?ObjectOptional parameters
options.units?stringcan 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(...);