7 ms·
You wish for it, HTML5 delivers. http://pepsdev.com/pendulums/ http://pepsdev.com/pendulums/
by gautier 15y ago
You wish for it, HTML5 delivers. http://pepsdev.com/pendulums/ http://pepsdev.com/pendulums/
- city41 15y agoA slight tweak to draw the pendulums too makes the simulation look much nicer: function draw (Ls, t, h) { // only for in the program, needed? for (var i = 0; i < Ls.length; i++) { ... ctx.lineTo(h * L, 0) ctx.arc(h * L, 0, 6, 0, 360) ctx.stroke() ctx.fill() ... } } to do it right you really need to start another path, but this works fine in Chrome (looks little wonky in Firefox)
- gautier 15y agothanks, that's much nicer indeed.
- dmvaldman 15y agoawesome! at 60 seconds my theory is confirmed! thanks
- a3_nm 15y agoDon't miss the moiré patterns in the wires.