W17
W17
3D
from browser import document import math
準備繪圖畫布
''' canvas = document["canvas1"] ctx = canvas.getContext("2d") '''
def axises(ctx): ctx.beginPath() # 設定線的寬度為 5 個單位 ctx.lineWidth = 5 # 將畫筆移動到 (0, 0) 座標點 ctx.moveTo(0, 0) # 然後畫直線到 (100, 0) 座標點 ctx.strokeStyle = "red" ctx.lineTo(100, 0) ctx.lineTo(90, 10 ...
more ...