How to use arc() to draw a circle in JavaScript

1 Answer

0 votes
<canvas id="canvas"></canvas>
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;

// void ctx.arc(x, y, radius, startAngle, endAngle, anticlockwise);

ctx.beginPath();
ctx.arc(100, 100, 70, 0, 2 * Math.PI);
ctx.stroke();

</script>

 



answered May 27, 2016 by avibootz

Related questions

1 answer 198 views
1 answer 138 views
1 answer 241 views
1 answer 561 views
...