Skip to content

KBE3D / KBCore / turf / angle

函数: angle()

angle(startPoint: Coord, midPoint: Coord, endPoint: Coord, options?: { explementary?: boolean; mercator?: boolean; }): number

Function

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.

参数

startPoint

Coord

Start Point Coordinates

midPoint

Coord

Mid Point Coordinates

endPoint

Coord

End Point Coordinates

options?

Optional parameters

explementary?

boolean

Returns the explementary angle instead (360 - angle)

mercator?

boolean

if calculations should be performed over Mercator or WGS84 projection

返回

number

Angle between the provided points, or its explementary.

示例

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

KBE3D @3.0.0 Copyright © 2024-present KBE3D