node package manager

Introducing npm Enterprise add-ons. Integrate third-party dev tools into npm…


Generate star polygons


Generates a regular star polygon.

console.log(require("star-polygon")(5, 2))
//  [[0,2], [2,4], [4,1], [1,3], [3,0]] 
npm install star-polygon

Generates a star polygon.

  • n is the number of vertices
  • k is the step size between vertices

Returns A list of edges

(c) 2013 Mikola Lysenko. MIT License