destination
描述
¥Description
获取一个 点 对象,并根据距离(以度、弧度、英里或公里为单位)计算目标点的位置;方位角(以度为单位)。本模块使用 半正矢公式 来计算全局曲率。
¥Takes a Point and calculates the location of a destination point given a distance in degrees, radians, miles, or kilometers; and bearing in degrees. This uses the Haversine formula to account for global curvature.
参数
¥Parameters
| 名称 | 类型 | 描述 |
|---|---|---|
| origin | 坐标系 | 起始点 |
| distance | number | 距原点的距离 |
| bearing | number | 范围从 -180 到 180 |
| options? | 对象 | 可选参数(默认值:) |
| options.units? | 单位 | 支持所有有效的 Turf 单位(默认为 'kilometers') |
| options.properties? | 对象 | 将属性转换为点(默认 ) |
返回
¥Returns
¥Feature<Point> destination point
示例
¥Examples
var point = turf.point([-75.343, 39.984]);
var distance = 50;
var bearing = 90;
var options = { units: "miles" };
var destination = turf.destination(point, distance, bearing, options);
安装
¥Installation
$ npm install @turf/destination
import { destination } from "@turf/destination";
const result = destination(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.destination(...);