Drawing arcs using the arcTo method

This tutorial explains how to draw arcs using the arcTo method. You will learn how to draw arcs and join arcs to other lines on the canvas.

This is what the arc attached to lines will look like:

Screen Shot 2015-05-08 at 6.56.39 pm

Watch the video below and then scroll down to see the sample code.

Here is the sample code:

<!DOCTYPE html>
 <title>The arcTo method</title>
 background-color: white;
 border: 1px solid black;
 function draw(){
 var ctx = document.getElementById("myCanvas").getContext("2d");
 ctx.arcTo(250,50,250,100,50); // x1, y1, x2, y2, radius
 window.onload = draw;
 <canvas id="myCanvas" width="500" height="350">

Next tutorial: Drawing quadratic curves