# 根据点、距离和角度计算目标点(rhumbDestination)
> npm install @turf/rhumb-destination
Returns the destination Point having travelled the given distance along a Rhumb line from the origin Point with the (varant) given bearing.
获取以入参的点为参照物,通过指定单位的距离计算出沿恒向线 (opens new window) (opens new window) 的目标点的位置
参数
参数 | 类型 | 描述 |
---|---|---|
origin | Coor | 参与计算的点 |
distance | number | 参与计算的线段 |
bearing | number | 与正北的角度,范围从-180 到 180 度 |
options | Object | 可配置项 |
options 选项
属性 | 类型 | 默认值 | 描述 |
---|---|---|---|
units | string | kilometers | 单位,可选的有 degrees、radians、miles、kilometers |
properties | Object | {} | 输出 GeoJSON 的 properties 属性 |
返回
Feature<Point> - Destination point。
示例
var pt = turf.point([-75.343, 39.984], { "marker-color": "F00" });
var distance = 50;
var bearing = 90;
var options = { units: "miles" };
var destination = turf.rhumbDestination(pt, distance, bearing, options);
/*
{
type: "Feature",
geometry: {
type: "Point",
coordinates: [-74.3985529486182, 39.984]
},
properties: {}
}
*/
基础用法
Copy
动态绘制
Copy