README
polygonal
NodeJs module for getting polygonal numbers
The Polygonal Numbers
Polygonal numbers are numbers that can be arranged in a regular polygon if they're represented as dots.
eg.:
Triangular numbers
Formula
The formula to get the nth polygonal number of a s-sided polygon is:
Installation
This module is on the npm repository, to intall it run the following command
$ npm install polygonal
Usage
var polygonal = require('polygonal');
// get the second pentagonal
var x = polygonal.getSGonal(5, 2);
var y = polygonal.getPentagonal(2);
// x is equal to y!!