I tried the JS polyfill on some of the basic XSLT that I wrote, and it only kinda worked. I can't imagine how it would fail on anything with any complexity.
Was thinking about vectorizing these and using a pen plotter to make some cool art for my wall, but the images are not very high resolution, unfortunately :(
One may attach JavaScript onClick action Listeners to any SVG named object (see attributes menu in inkscape.) For security reasons, this trick only works on live web server pages, and can't be run off the local file systems in most browsers.
While I would never allow uploading SVG formats to a public server... a vector format is great for line art style interface. =3
It's way off. My first guess was that there was something wrong with the physics code, but after carefully checking against this[1] derivation of the Hamiltonian it seemed fine, and once I wrapped my head around the JavaScript the RK4 integration[2] checked out as well.
So, what else might be wrong I wondered. Well, it seems to move in the wrong direction... so I checked how the pendulum is displayed. And sure enough, I think there's a sign error:
Note how the upper bob uses ang0 while the lower one has -ang1. Meanwhile the physics derivation assumes both angles are against the vertical, so have same sign.
Changing -ang1 to ang1 does indeed make the pendulum move in a natural way, except now dragging it is flipped. Ie you drag it left and it moves right. Another sign error in setLowerBobPos. Fixing that as well it now works as I'd expect.
When you bring up the lower mass and let it go, it seems to push the upper mass away, which should never happen. This whole site smells off vibe coded jank.
A vibe-coded double pendulum sim should produce a much better result than the physics on this page. Claude Code made this just now off one prompt, the physics are much better: https://keir.is/swinging
reply