Classical billiards with reflections off boundary walls, integrable or chaotic depending on table shape
This program simulates a billiard ball moving in a straight line inside a bounded planar domain, reflecting off the boundary walls according to the law of reflection (angle of incidence equals angle of reflection). The shape of the boundary determines whether the dynamics are integrable (as in an elliptical table) or chaotic (as in a stadium-shaped table). The trajectory is computed by detecting boundary intersections and reflecting the velocity vector.
Controls: Click and drag to orbit, scroll to zoom.