booleanClockwise
描述
¥Description
Takes a ring and return true or false whether or not the ring is clockwise or counter-clockwise.
参数
¥Parameters
名称 | 类型 | 描述 |
---|---|---|
line | 特性<LineString> | LineString | 数组<数组<number>> | 待求值 |
返回
¥Returns
boolean 真/假
¥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(...);