arcTo (a path command)

suggest change
context.arcTo(pointX1, pointY1, pointX2, pointY2, radius);

Draws a circular arc with a given radius. The arc is drawn clockwise inside the wedge formed by the current pen location and given two points: Point1 & Point2.

A line connecting the current pen location and the start of the arc is automatically drawn preceding the arc.

<!doctype html>
    body{ background-color:white; }
    #canvas{border:1px solid red; }

    // get a reference to the canvas element and it's context
    var canvas=document.getElementById("canvas");
    var ctx=canvas.getContext("2d");

    // arguments
    var pointX0=25;
    var pointY0=80;
    var pointX1=75;
    var pointY1=0;
    var pointX2=125;
    var pointY2=80;
    var radius=25;

    // A circular arc drawn using the "arcTo" command. The line is automatically drawn.
    ctx.arcTo(pointX1, pointY1, pointX2, pointY2, radius);

}); // end window.onload
    <canvas id="canvas" width=200 height=150></canvas>

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents