YouTip LogoYouTip

Met Canvas Arcto

# HTML canvas arcTo() Method [![Image 8: Canvas Object Reference](#) Canvas Object](#) ## Example Create an arc between two tangents on the canvas: YourbrowserdoesnotsupporttheHTML5canvastag. JavaScript: var c=document.getElementById("myCanvas"); var ctx=c.getContext("2d"); ctx.beginPath(); ctx.moveTo(20,20); // Create starting point ctx.lineTo(100,20); // Create horizontal line ctx.arcTo(150,20,150,70,50); // Create arc ctx.lineTo(150,120); // Create vertical line ctx.stroke(); // Draw [Try it Β»](#) * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) Internet Explorer 9, Firefox, Chrome, and Safari support the arcTo() method. **Note:** Opera does not support the arcTo() method. **Note:** Internet Explorer 8 and earlier versions do not support the element. * * * ## Definition and Usage The arcTo() method creates an arc/curve between two tangents on the canvas. **Tip:** Use the [stroke()](#) method to actually draw the arc on the canvas. | JavaScript syntax: | _context_.arcTo(_x1,y1,x2,y2,r_); | | --- | ## Parameter Values | Parameter | Description | | --- | --- | | _x1_ | The x-axis coordinate of the first control point. | | _y1_ | The y-axis coordinate of the first control point. | | _x2_ | The x-axis coordinate of the second control point. | | _y2_ | The y-axis coordinate of the second control point. | | _r_ | The radius of the arc. | * * Canvas Object](#)
← Met Canvas IspointinpathMet Canvas Arc β†’