Double pendulum · glm-5.3
Output generated Cost / run $0.0114 Runtime 24.3s
Prompt for this run
Simulate a chaotic double pendulum on a canvas using the correct equations of motion, drawing the arms and a colorful fading trail of the tip.
TAKE IT TO CODE
A single self-contained HTML file — copy it and open in any browser, or reuse the prompt with your own pi-agent run.
RUN
METRICS
Transcript · 4 messages
Simulate a chaotic double pendulum on a canvas using the correct equations of motion, drawing the arms and a colorful fading trail of the tip.
index.html (4414 bytes)Successfully wrote 4414 bytes to index.html
Done — `index.html` contains the complete simulation: - **Physics**: exact double-pendulum equations of motion (standard point-mass Lagrangian form) integrated with 4th-order Runge–Kutta at 240 Hz substeps, so energy stays near-conserved (displayed in the HUD). - **Rendering**: canvas arms with two bobs, plus a ~900-point fading trail of the tip drawn with a cycling rainbow hue, thickness and alpha growing toward the newest point, over a slow-fading background. - **Interaction**: click anywhere to kick the tip toward the cursor, press `r` to reset with new random initial angles, resizes with the window.