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

1 Answer

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

// void ctx.arcTo(x1, y1, x2, y2, radius);

ctx.beginPath();
ctx.moveTo(150, 30);
ctx.arcTo(150, 120, 60, 30, 30);
ctx.stroke();

</script>

 



answered May 27, 2016 by avibootz
...