Blog Archives

SVG Polygon Generator

OK, so the hexagon generator in the previous post seems a little inadequate in hindsight. So here is the code for a more general, regular, convex polygon. function polygon(x,y,rad,sides) { var path = “M “; for (a=0;a<sides;a++) { if (a>0)

Tagged with: , ,
Posted in jQuery SVG, SVG