n-gon

1.0.0 • Public • Published

n-gon

create regular polygons with n sides

stop sign

usage

npm badge

A "polygon" is just an array of [ x, y ] points, which allows you to map it to a new size and position.

const gon = require('n-gon')
 
let polygon = gon(7)
  .map([ x, y ] => [
    x * size + offset[0],
    y * size + offset[1]
  ])

license

MIT © Brandon Semilla

/n-gon/

    Package Sidebar

    Install

    npm i n-gon

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    8.02 kB

    Total Files

    5

    Last publish

    Collaborators

    • semibran