Skip to main content
Version: 7.3.0

rhumbDistance

描述

¥Description

计算 单位 中两个 points 点之间沿等角线的距离

¥Calculates the distance along a rhumb line between two points in Units

参数

¥Parameters

名称类型描述
from坐标系原点
to坐标系目标点
options?对象可选参数(默认值:
options.units?单位支持所有有效的 Turf 单位(默认为 'kilometers')

返回

¥Returns

number 两点之间的距离

¥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(...);