Skip to content

semibran/n-gon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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]
  ])

About

🛑 create regular polygons with n sides

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published