booleanClockwise
描述
🌐 Description
获取一个环,并返回 true 或 false,以判断该环是顺时针还是逆时针。
🌐 Takes a ring and return true or false whether or not the ring is clockwise or counter-clockwise.
参数
🌐 Parameters
| 名称 | 类型 | 描述 |
|---|---|---|
| line | Feature<LineString> | LineString | Array<Array<number>> | 待评估 |
返回
🌐 Returns
boolean true/false
示例
🌐 Examples
var clockwiseRing = turf.lineString([
[0, 0],
[1, 1],
[1, 0],
[0, 0],
]);
var counterClockwiseRing = turf.lineString([
[0, 0],
[1, 0],
[1, 1],
[0, 0],
]);
turf.booleanClockwise(clockwiseRing);
//=true
turf.booleanClockwise(counterClockwiseRing);
//=false
安装
🌐 Installation
$ npm install @turf/boolean-clockwise
import { booleanClockwise } from "@turf/boolean-clockwise";
const result = booleanClockwise(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.booleanClockwise(...);