var davis = require('./js/davis.js'); var geo = require('./js/geo.js'); var ngon = function (c) { var n=c.n || 3; var ctx= c.context || false; var x=c.x || 500; var y=c.y || x; var r=c.r || 500; if (n%2==0){ var rotation=360/(n*2)*davis.random(n*2); } else { var rotation=90+(180*davis.random(2)); }; rotation=c.rotation || rotation; var color=c.color || davis.randomColor("grey"); var lineWidth=c.lineWidth || 1; var fill=c.fill || davis.randcomColor(); ctx.beginPath(); for (var i=0;i