1.0.2 • Published 9 years ago

polygonal v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

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

Triangular numbers

Formula

The formula to get the nth polygonal number of a s-sided polygon is:

polygonal formula

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!!

###References http://en.wikipedia.org/wiki/Polygonal_number