亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

代碼
提交代碼
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>慕課網Wiki</title> <style> #imooc{ border:1px solid #ccc; } </style> </head> <body> <canvas id="imooc">您的瀏覽器不支持 HTML5 canvas 標簽</canvas> <script> const canvas = document.getElementById('imooc'); canvas.width=300 canvas.height=300 const ctx = canvas.getContext('2d'); // 繪制弧線 ctx.beginPath(); ctx.moveTo(40,40); ctx.arcTo(260,40, 260,200, 60); //調用了繪制圓的函數 ctx.strokeStyle = "#456795"; ctx.lineWidth = 4; ctx.stroke(); // ==============一下內容為復制內容================= // 繪制切線 ctx.beginPath() ctx.strokeStyle="#ccc"; ctx.lineWidth=1; ctx.moveTo(40,40); ctx.lineTo(260,40); ctx.lineTo(260,260); ctx.stroke(); //繪制P點 ctx.beginPath(); ctx.arc(260,40,4,0, 2*Math.PI) ctx.fillStyle = "#000" ctx.fill() //繪制A點 ctx.beginPath(); ctx.arc(40,40,4,0, 2*Math.PI) ctx.fillStyle = "#000" ctx.fill() //繪制B點 ctx.beginPath(); ctx.arc(260,200,4,0, 2*Math.PI) ctx.fillStyle = "#000" ctx.fill() //繪制切點 ctx.beginPath(); ctx.arc(200,40,4,0, 2*Math.PI) ctx.fillStyle = "yellow" ctx.fill() //繪制切點 ctx.beginPath(); ctx.arc(260,100,4,0, 2*Math.PI) ctx.fillStyle = "yellow" ctx.fill() //繪制圓心 O 點 ctx.beginPath(); ctx.arc(200,100,4,0, 2*Math.PI) ctx.fillStyle = "blue" ctx.fill() //繪制輔助圓 ctx.beginPath(); ctx.lineWidth = 1; ctx.strokeStyle="#ccc" ctx.arc(200,100,60,0, 2*Math.PI) ctx.stroke() </script> </body> </html>
運行結果