Sierpinski's Dots

Okay kids, the principle behind this one is "order from chaos", a common theme in fractals. To run the program, click on the black area repeatedly. If you want to start over, hold down the shift key while you click the black area. You can also change things around by typing different numbers in the boxes. I'll explain what's happening at the bottom of the page.

Sierpinski's triangle applet cannot be viewed on your browser


So what's this thing doing, Russell?

I'm glad you asked that question. It is exhibiting random behavior, that's what.

Well, not completely random. Each one of those 200 little colored dots (or whatever number you picked) has its own position and color. In the beginning of the program, and every time you shift-click, the dots all pick a totally random screen location and go there. Every time you click (without the shift key) on the window, each one of those dots picks a new spot to go to and moves toward it.

See those three big white dots forming a triangle? Well, when you click the window, the small colored dots all pick one of those three points AT RANDOM and move exactly HALFWAY toward it. You can change the frame rate by typing a number in the second window. This is designed to display 30 frames per second at top speed, so if the number is 30 it will take 1 second.

But what's this shape that you end up with if you keep on clicking? It looks like a triangle, but there are triangular holes in it. Well, it's called a Sierpinski triangle, and it's a fine example of a fractal. This is a "self-similar object", because when if you magnify a small piece of the shape, it looks like a smaller copy of the full sized image. For instance, look at the whole triangle. It's basically made of three smaller triangles and a fourth empty triangle (upside down), right? Now look closely at one of the three colored triangles. It's ALSO made up of three smaller triangles and a fourth empty triangle. So focus on one of the smaller triangles. That is ALSO made up of three smaller triangles... well, you get the idea.

To see a very detailed Sierpinski triangle, try setting the number of dots to a high number (10000 is good if your computer can handle it) and the number of frames to 0, then click the window about ten times.

In theory, fractals have infinite detail. In practice, the triangles can't be smaller than a screen pixel, but they are still very detailed. Welcome to the wonderful world of fractals. I will probably be putting more interactive fractal applications up in the future.


Back to the Java page