canvas

document.querySelector()
canvas.width canvas.height
canvas.getContext('2d')

状态
context.moveTo(x,y)
context.lineTo(x,y) --- context.lineWidth
context.arc(x,y,r,startAngle,endAngle,anticlockwise)

绘制
context.stroke() --- context.strokeStyle
context.fill() --- context.fillStyle

context.beginPath() //只调用这个就可以不封闭了 没必要成对调用
context.closePath() //会自动把收尾项链 ,对于fill()其实没有什么卵用

物理学结合代码 加速度、位移

原文地址:https://www.cnblogs.com/so-letitgo/p/4549896.html