Skip to content

Naive implementation of the chaos game to build a Sierpinksi triangle.

License

Notifications You must be signed in to change notification settings

jakes44/sierpinski_triangle

Repository files navigation

Sierpinski Triangle Generator using "chaos game"

The Sierpinksi triangle is a fractal and set with the shape of an equilateral triangle. It is made by recursively subdividing the triangle into smaller equilateral triangles.

My implementation uses what is called the chaos game. This is done by picking a random point within the triangle, finding the midpoint between that point and a random vertex, and plotting that midpoint. That midpoint is saved as the starting position and the process repeats.

To clear up some noise, I throw out every 4th point. Not that great, but it helps.

Images (There is a video of it in action in the repository)

Best Pixel Ok Pixel

What its done with

Implemented in python using matplotlib animations. Good stuff.

Wikipedia articles used for reference

About

Naive implementation of the chaos game to build a Sierpinksi triangle.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages