How to draw a circle with arc() in JavaScript

1 Answer

0 votes
<canvas id="canvas" width="1024" height="600"></canvas>
<script type="text/JavaScript">   

var ctx = document.getElementById('canvas').getContext('2d');
  
//void ctx.arc(x, y, radius, startAngle, endAngle, anticlockwise);
  
ctx.beginPath();
ctx.arc(50, 50, 40, 0, Math.PI * 2, true);
ctx.stroke();

</script>

 



answered May 26, 2016 by avibootz

Related questions

1 answer 169 views
1 answer 138 views
1 answer 241 views
1 answer 560 views
...