... please wait

Jeremy Aaron Heminger

Systems Programmer / Web Developer Located in Southern California

The Chaos Game (Sierpinski Triangle)

This is a fun little experiment that proves that strange attractors really exist. The result can be easily reproduced in the real world with a ruler, a pencil and a piece of paper. It’s not just some philosophical idea or some far out complicated mathematics. 

The experiment is known as the Chaos Game. It’s possible to perform the experiment by hand but realistically, it would take quite awhile and a lot of effort as the steps would need to be repeated at least 100 times to begin to see a result. So, to make things easier, I created the experiment in code:

http://wesmantooth.jeremyheminger.com/examples/chaos.php.

The code uses the Wes Mantooth game engine.

  1. Create a triangle using only points. Let each dot be represented by 2 sides of a 6 sided die.
  2. Place a single dot in a random location. Make sure the dot is within the boundaries of the triangle.
  3. Roll a six-sided die. Using a ruler, place a dot 1/2 the distance from the first dot to the point on the triangle corresponding to the roll.
  4. Roll the die again and repeat the process.
  5. Eventually, if the process is repeated enough times, a patter will emerge.
  6. Ta da!
Linux
Apache
MySQL
PHP
HTML5
CSS3
JavaScript
jQuery
Grunt
Sass
Git / GitHub
WordPress
Drupal
TypeScript
C#
Oracle SQL Developer
Visual Studio