Click on the green flag and watch.
The Sierpinski triangle, along with the Mandelbrot set, are two of the iconic images of Fractals and Chaos theory. The mathematician Michael Barnsley created a theorem called the Collage Therem that gives us the mathematics for playing the 'Chaos Game' (the common source for the Sierpinski Triangle) to compute ANY image! Perhaps you've seen the ferns (a soon to be uploaded project) and other images produced by the Collage Theorem (called Iterated Functions Systems by Barnsley). Geometrically, the Collage Theorem is the mathematics for creating an affine geometric transformation which is a combination of translations, rotations, and scalings (taught in secondary mathematics). Every image has a unique set of values for A, B, C, D, E, and F. Plug those values into an algorithm like the one in this project and compute the image! The Chaos Game is usually presented as a random application of the midpoint theore, a typical algebra I topic. In the future I will upload the midpoint formula as used in playing the Chaos Game. It computes the same image computed in this project.