<!--
/*
* ---------------------------------------------
* Project: Regular Polygon generator
* Autor: Daniel Martinez <www.webofilia.com>
* ---------------------------------------------
*/
-->
<script src="RegularPolygon.js" type="text/javascript"></script>
<h4>Demo Example</h4>
<canvas id="canvasPol" width="400" height="400" style="border:1px solid #ccc">This browser doesn't support Canvas element</canvas>
<script type="text/javascript">
//Triangle
var Triangle= {
n:3,
strokeStyle:'#333',
fillStyle:'#528B8B',
lineWidth:4,
lSide:250,
x:315,
y:370,
rotationAngle:180
};
//Pentagon
var Pentagon = {
n:5,
strokeStyle:'#666',
fillStyle:'#b21303',
lineWidth:5,
lSide:75,
x:25,
y:70,
rotationAngle:0
};
var rpGen = new RegularPolygonGenerator('canvasPol');
rpGen.generate(Triangle,Pentagon);
rpGen.draw();
</script> |