Sierpinski Triangle

Click anywhere to start!

The Sierpinski Triangle is a popular fractal, known for being remarkably easy to draw and its pleasing shape.

To generate this fractal, we could recursively add upside-down equilateral triangles to the center of the space left around placing the previous triangle, until the shape is made.

However, in this case, we use a Chaos game approach. First you click anywhere on the screen and the first dot appears. Then, we randomly choose a vertex from the main shape and place a new dot halfway between the two. Now using this new point and another random vertex from the main shape we go halfway between these and repeat.

Just for your amusement, you can also see what this strategy will do for other shapes larger than a triangle. And you can even try changing the distance between the two points the next point will be placed.

While this idea wasn't inspired by this question, you may find it interesting to know why this fractal and the distance between the two points is important. Check out this maths stack exchange post 🔗.

Settings

Total Points: 0