Koło, elipsa, odcinek i wycinek (1)
Strona używa skryptu figures.js
Listing
var cv = document.getElementById("canvas"); var ctx = cv.getContext("2d"); var oval = new Oval(new Point(100,60), 50, 0, 2* Math.PI, 50, false); oval.fillStyle = "#00aaff"; oval.fill=true; oval.draw(ctx); var oval1 = new Oval(new Point(250,60), 50, 0, 2* Math.PI, 30, false); oval1.fillStyle = "#00aaff"; oval1.fill=true; oval1.draw(ctx); var oval2 = new Oval(new Point(100,180), 50, Math.PI/2, Math.PI, 50, false); oval2.fillStyle = "#00aaff"; oval2.fill=true; oval2.draw(ctx); var oval3 = new Oval(new Point(250,180), 50, Math.PI/2, Math.PI, 30, false); oval3.fillStyle = "#00aaff"; oval3.fill=true; oval3.draw(ctx); var oval4 = new Oval(new Point(100,280), 50, Math.PI/2, Math.PI, 50, true); oval4.fillStyle = "#00aaff"; oval4.fill=true; oval4.draw(ctx); var oval5 = new Oval(new Point(250,280), 50, Math.PI/2, Math.PI, 30, true); oval5.fillStyle = "#00aaff"; oval5.fill=true; oval5.draw(ctx);