This simulation needs WebAssembly, and it could not start in this browser.
The image is a frame from a real run. Check that JavaScript is on, or try another browser.
A billiard is a ball moving in straight lines inside a closed table and reflecting off its edge. In a circle or a rectangle the motion is regular: each trajectory keeps a conserved quantity and stays on a narrow family of paths. In the 1970s Leonid Bunimovich proved that the stadium, two semicircles joined by straight sides, is ergodic and mixing. A typical trajectory eventually passes arbitrarily close to every point of the table in every direction. This came as a surprise, because the stadium’s walls are either flat or focusing, and until then chaos in billiards was known only from tables with dispersing walls, as in Sinai’s billiard. The mechanism is defocusing: a curved cap focuses a beam of parallel rays, the rays cross and then spread apart, and on a long enough flight they spread more than they converged.
What you see
All balls start together from one point near the center, heading in directions evenly spaced around the circle. Each step moves every ball to its next collision with the wall and draws that chord into the picture, eight chords per ball per frame. The whole image fades a little at every step, so bright regions are the ones crossed often in the recent past. The wall itself is not drawn, but the chords soon trace out its shape. Lengths are in units of the cap radius.
Stadium (w=2): six balls in a stadium whose straight section is as long as the caps are wide. The balls part ways after a few bounces, and the chords soon cover the whole table with a fairly even glow.
Wide stadium (w=4): eight balls and a straight section twice as long. The table is still ergodic and the chords still fill it.
Circle (w=0, integrable): four balls in a circle. Here the angle between a chord and the wall is the same at every bounce, so each ball’s chords all touch an inner circle, its caustic, and the region inside that circle is never crossed. The balls start only 0.07 from the center, so their chords are almost diameters, and the picture fills up as a dense star of near-diameters that is brightest at the center.
The rules
Between collisions a ball moves in a straight line at constant speed. At the wall, with unit normal , the velocity is reflected:
The table consists of two semicircles of radius 1 joined by straight segments of length . For any almost every trajectory has a positive Lyapunov exponent: two balls that start a tiny distance apart separate exponentially from bounce to bounce. In the circle, , the angle of incidence is conserved and the motion is integrable.
Parameters
Straight section width w: the length of the straight sides, 0 to 4 (default 2).
Number of balls: 1 to 12 (default 6).
Trail fade rate: the factor by which the image fades at every step, 0.990 to 0.9999 (default 0.997). Values closer to 1 keep a longer memory.