Double pendulum · qwen3-coder-next
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.
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.
/tmp/ws/index.html (9123 bytes)Successfully wrote 9123 bytes to /tmp/ws/index.html
Done! I've created a complete double pendulum simulation in a single self-contained HTML file. The simulation includes: - **Physics**: Uses the correct Lagrangian equations of motion for a double pendulum with proper coupled differential equations - **Visuals**: - Colorful fading trail that shows the chaotic motion pattern - Glowing bobs with different colors (red and teal) - Dark background with transparent trail fading - **Interactivity**: You can click and drag on the canvas to reposition the pendulum - **Controls**: Reset button to start fresh The simulation demonstrates the chaotic nature of the double pendulum system, where small changes in initial conditions lead to vastly different trajectories over time. The trail creates beautiful, intricate patterns as the pendulum evolves.
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.