We're going to start with a fantastic piece by Keith Peters. What a great way to kick off the Flash-a-thon! ~Kristin
Author: Keith Peters
The Chaos Game is a simple algorithm that can produce some surprising fractal forms. This one has been done in 3D. More info here: http://mathworld.wolfram.com/ChaosGame.html
For live version, and source files, continue reading.
Click to start and stop the animation.
Basically, you take a polygon, a random point. and a ratio. Choose one of the "corners" of the polygon at random and find the point at the specified ratio between that corner and the point. Then choose another corner at random, and find the point at the same ratio between the last point and the corner. Repeat about 10,000 times.
In the source, there are two parameters, sides and ratio. They have been set up to create a 3-sided polygon (triangle) with a ratio of 1/2. This creates the famous Sierpinski triangle. Choosing other values gives you results like this:
This work is licensed under a
Creative Commons GNU General Public License License and a
Creative Commons Attribution 3.0 United States License.