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

    Install

    npm i turf-is-clockwise

    DownloadsWeekly Downloads

    803

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar