//ctx is a canvas context ctx.beginPath(); var x = 50; // The x-coordinate. var y = 50; // The y-coordinate. var radius = 20; // The arc radius; you need to calculate it, if you want to set it using mouse var startAngle = 0; // The starting point on the circle. //endAngle in radius = angle * (Math.PI / 180) var endAngle = 180 * (Math.PI / 180); // The end point on the circle, half a circle = 180 degrees var clockwise = false // The direction of drawing = clock wise ctx.arc(x, y, radius, startAngle, endAngle, clockwise); // Create the arc path. ctx.stroke();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)