Łuk koła i wycinek koła (2)
Listing
var cv = document.getElementById("canvas"); var ctx = cv.getContext("2d"); ctx.beginPath(); var x = 100; var y = 50; var radius = 30; var startAngle = 1.5*Math.PI; var endAngle = 0; var counterClockwise = true; ctx.arc(x, y, radius, startAngle, endAngle, counterClockwise); ctx.lineWidth = 5; ctx.strokeStyle = "black"; ctx.stroke(); //- ctx.beginPath(); var x = 100; var y = 150; var radius = 30; var startAngle = 1.5*Math.PI; var endAngle = 0; var counterClockwise = true; ctx.arc(x, y, radius, startAngle, endAngle, counterClockwise); ctx.lineTo(x,y); ctx.closePath(); ctx.fillStyle = "#00aaff"; ctx.fill(); //- ctx.beginPath(); var x = 100; var y = 250; var radius = 30; var startAngle = 1.5*Math.PI; var endAngle = 0; var counterClockwise = true; ctx.arc(x, y, radius, startAngle, endAngle, counterClockwise); ctx.lineWidth = 5; ctx.strokeStyle = "black"; ctx.stroke(); ctx.lineTo(x,y); ctx.closePath(); ctx.fillStyle = "#00aaff"; ctx.fill(); //- ctx.beginPath(); var x = 200; var y = 150; var radius = 30; var startAngle = 1.5*Math.PI; var endAngle = 0; var counterClockwise = true; ctx.arc(x, y, radius, startAngle, endAngle, counterClockwise); ctx.closePath(); ctx.fillStyle = "#00aaff"; ctx.fill();