The Chaos Game

The steps of the Chaos Game are as follows:

  1. Pick a random point in the metric space of the IFS. Call this point p.
  2. Pick a random function from the IFS. Call this function f.
  3. Apply f to p. Set p to f(p).
  4. Go to the second step.

In the demonstration below, you can see how the Chaos Game can be used to create a fractal. Hold the up arrow on the spinner to generate more points. The red point on the canvas represents the last point generated.

This fractal is generated using the rule that the next point to be drawn is calculated by halving the distance between the last point and a random one of the vertices of a polygon that surrounds the fractal. However, the same vertex of the polygon cannot be picked twice in a row.


Iterations:

Sides:

Variations

The following are some examples of variations used in the Fractal Flame algorithm

Variation Definition Sample Image
Linear Vx,y=(x,y)
Sinusoidal Vx,y=(sin(x),sin(y))
Spherical Vx,y=(xx2+y2,yx2+y2)
Horseshoe Vx,y=x-yx+yx2+y2,2xyx2+y2
Popcorn Vx,y=x+csin(tan3y),y+ksin(tan3x)
Eyefish Vx,y=2xr+1,2yr+1