Skip to content
determine if a polygon is clockwise or counter-clockwise
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
index.js
package.json
readme.md
test.js

readme.md

Polygon Direction

Determine if a polygon is clockwise or counter-clockwise

Install

npm install polygon-direction

Methods

var polydir = require("polygon-direction");

polydir(polygon)

Returns true if a polygon is clockwise, false if it it counter-clockwise.

polygon should be an array of 2-item arrays of coordinates.

Example

var polydir = require("polygon-direction");

console.log(polydir([[5,0],[6,4],[4,5],[1,5],[1,0]]));
Something went wrong with that request. Please try again.