@zanchi/n-gon

0.1.0 • Public • Published

n-gon

Create regular polygons with n sides

stop sign

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]

license

MIT © Brandon Semilla

Package Sidebar

Install

npm i @zanchi/n-gon

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • zanchi