turf-is-clockwise

1.0.0 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    686
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    686
  • 0.1.2
    1
  • 0.0.2
    1
  • 0.0.1
    1

Package Sidebar

Install

npm i turf-is-clockwise

Weekly Downloads

689

Version

1.0.0

License

MIT

Last publish

Collaborators

  • tcql
  • mourner
  • jvrousseau
  • jseppi
  • cspanring
  • cwmma
  • lyzidiamond
  • tmcw
  • morganherlocker