This chaos demo generates a triangle using the chaos game. In the chaos game you set three vertices of a triangle, randomly choose a starting position, then calculate the midpoint between the starting position and one of the randomly chosen vertices and place a dot. A second dot is then placed midway between the new point and a randomly chosen vertex. The process then continues.
You can see how the dots are placed by using the red dot option. Click on "Yes" and then click twice on the "Red Dots" button. You will see a dot. Click on the Red Dots button again and you will see another dot and notice that each new dot is midway between the last dot and one of the vertices. If you continue you will see that the red dots will continue to be placed midway between the last dot and one of the vertices. They are easier to find if you have 5000 or less density (try 500).
The other options are (click on the corresponding buttton after making a change):
If the text is under the star and hard to read you can change the dot size to zero. After reading the text you can put it back to one (or highter).
This pattern is called the Sierpinksi Triangle. Here is the pattern drawn using recursion.