Each ball is integrated as an independent simple pendulum: α = -(g/L)·sin(θ), with a small per-step multiplicative damping applied to angular velocity to model air resistance and imperfect elasticity.
When an end ball swings back through vertical (θ≈0) moving inward, its angular velocity is transferred wholesale to the ball at the opposite end, and every ball in between is reset to rest. This is the idealised rule Newton's cradle demonstrates: because momentum (mv) and kinetic energy (½mv²) must both balance in a near-elastic collision between equal masses, a single incoming ball can only launch a single outgoing ball at the same speed — not two balls at half speed, which would conserve momentum but not energy.
θ'' = -(g/L)·sin(θ)
ω *= damping (per substep)
if ball[0] crosses θ≈0 inward: transfer ω to ball[last]