“Chaos Game” Sierpinski Fractal Generation

“Chaos Game” Sierpinski Fractal Generation

This is a Sierpinski triangle fractal generated using the chaos game method, in which a point inside a triangle is copied halfway to any random vertex of the triangle. That is to say, we pick a point inside an initial triangle, then randomly select a corner in that triangle. We then take the x and y coordinates of that corner/vertex and find the difference between that and the coordinates of the starting point. Finally, we divide those differences by 2 and use those as the coordinates for the next point, and repeat. If you want, you can run the program I wrote to generate the fractal, or look at the code (in JavaScript) I used.