<!DOCTYPE HTML><HTML><Head> <MetaCharSet= "UTF-8"> <title>Canvas</title> <Scripttype= "Text/javascript"src=".. /js/jquery.js "></Script> <styletype= "Text/css"> *{margin:0;padding:0;Outline:None;Border:None; }#canvas{width:7rem;margin:. 25rem 0 0 1.5rem;Border:1px solid Black; } </style></Head><Body> <CanvasID= "Canvas"width= "+"Height= "All"></Canvas></Body></HTML><Scripttype= "Text/javascript"> /** * REM Layout initialization*/ $('HTML'). CSS ('font-size', $ (window). Width ()/( ten); /** Get canvas canvas * Get canvas drawing context*/ varCanvas= $('#canvas')[0]; varCXT=Canvas.getcontext ('2d'); /** * Draw round Arc (center of the Axis, the center of the ordinate, the length of the radius, the starting angle of the drawing, the end angle drawn, whether counterclockwise) * arc ArcTo (The horizontal axis of the first control point, the ordinate of the first control point, the horizontal axis of the second person's control point, Ordinate of the second control point, radius of the arc)*/ /*Cxt.arc (0, 2*math.pi, false); Cxt.fill (); */Cxt.save (); Cxt.linewidth= 3; Cxt.strokestyle= 'Red'; Cxt.moveto ( -, -); Cxt.arcto ( the, -, the, -, -); Cxt.stroke (); Cxt.restore (); /** * Auxiliary line*/Cxt.strokestyle= 'Green'; Cxt.moveto ( -, -); Cxt.lineto ( the, -); Cxt.lineto ( the, -); Cxt.stroke ();</Script>
HTML5 Canvas (drawing of circles and tangent curves) arc, ArcTo