turf-is-clockwise
turf isClockwise module
Last updated 12 years ago by morganherlocker .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install turf-is-clockwise 
SYNC missed versions from official npm registry.

turf-isClockwise

Build Status

Takes a ring and return true or false whether or not the ring is clockwise or counter-clockwise.

###Install

npm install turf-is-clockwise

###Parameters

name description
ring an array of coordinates

###Usage

isClockwise(ring)

###Example

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

Current Tags

  • 1.0.0                                ...           latest (12 years ago)

4 Versions

  • 1.0.0                                ...           12 years ago
  • 0.1.2                                ...           12 years ago
  • 0.0.2                                ...           12 years ago
  • 0.0.1                                ...           13 years ago
Maintainers (1)
Downloads
Total 34
Today 1
This Week 7
This Month 26
Last Day 1
Last Week 9
Last Month 4
Dependencies (0)
None
Dev Dependencies (2)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE