https://github.com/turfjs/turf-is-clockwise
https://github.com/turfjs/turf-is-clockwise
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/turfjs/turf-is-clockwise
- Owner: Turfjs
- License: mit
- Created: 2014-05-23T03:16:36.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-11T17:03:48.000Z (over 10 years ago)
- Last Synced: 2025-01-30T17:27:44.353Z (4 months ago)
- Language: JavaScript
- Size: 176 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
turf-isClockwise
================
[](https://travis-ci.org/Turfjs/turf-isClockwise)Takes a ring and return true or false whether or not the ring is clockwise or counter-clockwise.
###Install
```sh
npm install turf-is-clockwise
```###Parameters
|name|description|
|---|---|
|ring|an array of coordinates|###Usage
```js
isClockwise(ring)
```###Example
```js
var isClockwise = require('turf-is-clockwise')var clockwiseRing = [[0,0],[1,1],[1,0],[0,0]]
var counterClockwiseRing = [[0,0],[1,0],[1,1],[0,0]]var isCW = isClockwise(clockwiseRing)
var counterCW = isClockwise(counterClockwiseRing)console.log(isCW) // true
console.log(counterCW) // false
```