rhumbDistance
描述
¥Description
¥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(...);