在画布上创建介于两个切线之间的弧
<!DOCTYPE html>
<html>
<body>
<canvas id="myCanvas" width="300" height="200" style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.
</canvas>
<script>
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
ctx.beginPath();
ctx.beginPath();
ctx.moveTo(20,20); // 创建开始点1;
ctx.lineTo(100,20); // 创建水平线
ctx.arcTo(150,20,150,70,50); // 创建弧
//(150,20)弧的起点坐标2;(150,70)弧的终点坐标3;
ctx.lineTo(150,120); // 创建垂直线
ctx.arcTo(150,200,100,200,50); // 创建弧
ctx.lineTo(20,200); // 创建水平线
ctx.stroke();
</script>
</body>
</html>