JSPM

turf-is-clockwise

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1303
  • Score
    100M100P100Q109333F
  • License MIT

turf isClockwise module

Package Exports

  • turf-is-clockwise

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (turf-is-clockwise) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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