Side-on 2D rendering of the same real double-pendulum physics as the 3D version — a rigid upper link (θ₁) with a second rigid link and mass (θ₂) hinged to its end, not several independent single pendulums. Both angles are advanced together with the full nonlinear coupled equations of motion (no small-angle approximation — chaos does not survive linearizing), stepped with 4th-order Runge–Kutta:
θ1'' = [ -g(2m1+m2)sinθ1 - m2·g·sin(θ1-2θ2)
-2sin(θ1-θ2)m2(θ2'²L2+θ1'²L1cos(θ1-θ2)) ]
/ [ L1(2m1+m2-m2cos(2θ1-2θ2)) ]
θ2'' = [ 2sin(θ1-θ2)(θ1'²L1(m1+m2)+g(m1+m2)cosθ1
+θ2'²L2·m2cos(θ1-θ2)) ]
/ [ L2(2m1+m2-m2cos(2θ1-2θ2)) ]
The small inset in the corner of the canvas is a live phase-space trace: every frame it plots a point at (θ₁, θ₂), so instead of watching the swing you watch the state itself wander — a small, quasi-regular loop for gentle starting angles, and a dense, space-filling smear for a chaotic one. "Spawn twin" launches a second pendulum from θ₁+0.001° and tracks the separation d(t) between the two ornament tips; d(t) growing exponentially, d(t) ≈ d(0)·e^(λt), is the measurable signature of chaos, and λ is estimated live via Benettin's renormalization method (periodically rescaling the twin's separation back down so the exponent can be measured over a long run instead of the twin diverging into an unrelated swing).
- L₁ / L₂ — link lengths; changing either reshapes both the swing envelope and the phase-space trace.
- Mass ratio m₂/m₁ — a heavier lower ornament couples the two links more weakly; a lighter one couples them more strongly.
- Start angle θ₁ and drag the ornaments — sets the initial condition directly; drag to pan the view and scroll to zoom.
- Damping — a small angular-velocity drag term; set to 0 for an undamped conservative pendulum.