Skip to main content
Version: Next

angle

描述

¥Description

Finds the angle formed by two adjacent segments defined by 3 points.The result will be the (positive clockwise) angle with origin on the startPoint-midPoint segment, or its explementary angle if required.

参数

¥Parameters

名称类型描述
startPoint坐标系起点坐标
midPoint坐标系中点坐标
endPoint坐标系端点坐标
options?对象可选参数(默认
options.explementary?booleanReturns the explementary angle instead (360 - angle) (default false)
options.mercator?booleanif calculations should be performed over Mercator or WGS84 projection (default false)

返回

¥Returns

number Angle between the provided points, or its explementary.

示例

¥Examples

turf.angle([5, 5], [5, 6], [3, 4]);
//=45

安装

¥Installation

$ npm install @turf/angle

import { angle } from "@turf/angle";
const result = angle(...);
$ npm install @turf/turf

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