Sierpinski Gasket (a.k.a. Sierpinski Triangle)

Approximately every 40 seconds, the above animation will restart. The animation of this fractal was written in DHTML (Javascript and CSS).  For best results, this page should be viewed in Internet Explorer.  Apparently the HTML rendering engine (or perhaps the Graphics engine) of Mozilla Firefox is much slower than that of Internet Explorer, so the animation takes much longer to load and run under Mozilla Firefox.


The algorithm for this fractal was created in 1915 by Waclaw Sierpinski, long before the term "Fractal" was coined by Benoit Mandelbrot in 1975.


Waclaw Sierpinski was a famous Polish mathematician who even had a crater of the moon named after him.  Click here to read more about him at Wikipedia.


The following algorithm was used to create the above fractal.

  • 1.) Draw a white triangle.

  • 2.) Connect the midpoints of the triangle to create 4 smaller triangles (note that they have the same shape as the parent triangle, as expected in a fractal).

  • 3.) Paint the middle-most triangle white.

  • 4.) Repeat steps 2 and 3 with the other 3 triangles, and continue repeating until the generated triangles are too small to draw.



The following sites were very helpful in developing this program: