oneshotlm
Compare all models on this prompt →

Double pendulum · qwen3.6-35b-a3b

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.

⛨ sandboxed Open in new tab ↗
transcript · 6 messages
user

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.

assistant
thinking
The user wants a single-page HTML file that simulates a chaotic double pendulum with:
1. Correct physics equations of motion for a double pendulum
2. A canvas rendering the arms
3. A colorful fading trail of the tip position
4. All self-contained in one index.html file
5. No external resources

Let me build this with the correct Lagrangian-derived equations of motion for a double pendulum, using a numerical integrator (RK4 for accuracy).

The equations of motion for a double pendulum (with equal masses m1=m2=m, equal lengths l1=l2=l, and angles θ1, θ2 from vertical):

θ1'' = (-g(2m1+m2)sin(θ1) - m2*g*sin(θ1-2θ2) - 2*sin(θ1-θ2)*m2*(θ2'^2*l2 + θ1'^2*l1*cos(θ1-θ2))) / (l1*(2m1+m2-m2*cos(2θ1-2θ2)))

θ2'' = (2*sin(θ1-θ2)*(θ1'^2*l1*(m1+m2) + g*(m1+m2)*cos(θ1) + θ2'^2*l2*m2*cos(θ1-θ2))) / (l2*(2m1+m2-m2*cos(2θ1-2θ2)))

I'll use RK4 integration for accuracy, draw two arms, and use HSL color cycling for the trail with fading via semi-transparent overlay.
write /workspace/index.html (8703 bytes)
toolResult

Successfully wrote 8703 bytes to /workspace/index.html

assistant
thinking
Let me verify the file was created and looks good.
bash {"command":"wc -l /workspace/index.html && head -3 /workspace/index.html && echo \"---\" && tail -3 /workspace/index.html"}
toolResult

307 /workspace/index.html <!DOCTYPE html> <html lang="en"> <head> --- </script> </body> </html>

assistant
thinking
The file is created successfully. Let me summarize what was built.

Done — `/workspace/index.html` (307 lines, fully self-contained). Here's what's in it: **Physics** - Correct Lagrangian-derived equations of motion for a double pendulum (variable masses `m1, m2`, lengths `l1, l2`) - **RK4 (4th-order Runge-Kutta)** integration with 4 substeps per frame and `dt = 0.004` for excellent energy conservation and chaotic accuracy **Rendering** - Arms drawn with radial glow (warm orange for arm 1, blue for arm 2) - Bob 1 has a gradient orange sphere, Bob 2 (the tip) has a glowing white→blue sphere with a 18px outer glow - **Colorful fading trail**: up to 6,000 points drawn as circles, with HSL hue cycling over time and alpha fading based on trail age — older points shrink and become transparent **Interaction** - **Click & drag** the tip to reposition the pendulum (resets trail) - **Press `R`** to reset to initial conditions - Touch support included - Auto-resizes to window

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

modelqwen3.6-35b-a3b
vendorQwen
harnesspi-agent
generated2026-07-31

EVALUATION

4/5 working

Double pendulum simulates chaotic motion with vivid fading colorful trails; drag/reposition and click work as inputs.

Vision grade · anthropic/claude-sonnet-5

MEASUREMENTS

Raw readings from the capture, not a verdict — the grade above is the only judgement. Percentages are how much of the screen changed; the measure under-reports sparse motion on a dark background.

idle motion7.8%
on click10.6%
on drag12.7%
on wheel4.8%
on enter + space4.0%
on arrow keys4.9%
on w/a/s/d10.1%
frame spread27.8 / 255
console errors0
js errors none

METRICS

runtime35.6s
tokens in12k
tokens out3.9k
cached0
cost / run$0.0056