Skip to main content
Version: 7.3.0

rhumbBearing

描述

🌐 Description

取两个并沿等航线找到它们之间的航向角,即从北线(0度)开始测量的角度

🌐 Takes two points and finds the bearing angle between them along a Rhumb line i.e. the angle measured in degrees start the north line (0 degrees)

参数

🌐 Parameters

名称类型描述
startCoord起点
endCoord终点
options?Object可选参数 (默认 {})
options.final?boolean如果为真,则计算最终方位 (默认 false)

返回

🌐 Returns

number 从北方起的方位角,十进制度表示,介于 -180 到 180 度之间(顺时针为正)

示例

🌐 Examples

var point1 = turf.point([-75.343, 39.984], { "marker-color": "#F00" });
var point2 = turf.point([-75.534, 39.123], { "marker-color": "#00F" });

var bearing = turf.rhumbBearing(point1, point2);

安装

🌐 Installation

$ npm install @turf/rhumb-bearing

import { rhumbBearing } from "@turf/rhumb-bearing";
const result = rhumbBearing(...);
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.rhumbBearing(...);