@zanchi/n-gon
v0.1.0
Published
Create regular polygons with n sides
Downloads
2
Readme
n-gon
Create regular polygons with
n
sides
Install
npm install @zanchi/n-gon
Usage
A "polygon" is just an array of points
const { ngon, ngonVec } = require('@zanchi/n-gon');
const triangle = ngon(3, 10 /* optional size param */)
// triangle[0] === {x: 10, y: 0}
const square = ngonVec(4, 5);
//square[0] === [5, 0]