Double pendulum · nova-2-lite-v1
Output generated Cost / run $0.0126 Runtime 21.4s
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.
thinking
[REDACTED].
index.html (13958 bytes)Successfully wrote 13958 bytes to index.html
thinking
[REDACTED].
I've created a complete single-page web app for simulating a chaotic double pendulum in `index.html`. The implementation includes: 1. **Physics Simulation**: Accurate equations of motion for a double pendulum using Lagrangian mechanics 2. **Visual Effects**: - Colorful fading trail of the pendulum bob - Glass-morphism UI elements - Smooth animations with requestAnimationFrame 3. **Interactive Controls**: - Start/Pause/Reset buttons - Random parameter generator - Space bar to toggle simulation - Click to drop from random positions The simulation runs entirely client-side with no external dependencies. The pendulum's chaotic behavior emerges from the nonlinear coupling between the two arms, and the trail shows the history of the bob's position with gradually fading colors. You can open `index.html` in any modern browser to see the simulation in action.