Chaos Game Simulation
The Chaos Game is a method for generating a fractal through a random process. You start with a polygon with N sides and a randomly selected initial point. At each step of the process, one corner of the polygon is selected uniformly at random and a new dot is added at a specific fraction r of the distance to that corner. After a large number of steps, and with a suitable value of r, the dots form a fractal pattern within the polygon.
When r is large enough, there will be an area in the center of the polygon that eventually will never be reached by the process (except maybe in the first few steps, depending on the initial point). If that area cannot be reached, it means that a similarly shaped, smaller area partway to each corner of the polygon also cannot be reached. And then there are even smaller areas partway from there, and so on. This leads to the fractal pattern that emerges after the process has gone on for a long while.
For a triangle with r = 0.5, the process converges to the famous Sierpinski triangle.
Polygon (number of vertices):
Ratio r =
Simulation speed
Size of plotted points: