Below is a **single HTML file** that creates a self‑contained triple‑pendulum animation. The physics are handled with a simple Verlet integrator plus distance‑constraints, which gives a realistic motion that obeys gravity. Each mass leaves a fading trail, so you can see the path it follows. ```html Triple Pendulum ``` ### How it works 1. **Verlet integration** – each bob’s new position is computed from its current and previous positions plus gravity. 2. **Distance constraints** – after integration the three rod lengths (`L1`, `L2`, `L3`) are enforced by repeatedly adjusting the positions, giving a realistic rigid‑rod behavior. 3. **Trails** – every frame the current positions of the three moving bobs are pushed onto three separate arrays. Old points are discarded after `maxTrail` frames, and the trail is drawn with a fading alpha so the path slowly disappears. 4. **Rendering** – the canvas is cleared each frame, trails are drawn first (so they appear beneath the pendulum), then the rods and the three bobs are drawn. Open the file in any modern browser and you’ll see a continuously moving triple pendulum, each bob leaving a colorful fading trail behind it. No controls or user interaction are required. Enjoy!