How Gasket Works

Gasket works by plotting pixels according to a "drawing rule". The drawing rule is simple and repetetive, but the results are fascinating. Here's how it works.

You start out with a number of "control points". Gasket represents these points with small, colored rectangles, like this:
Next, pick any location on the picture as a starting location. Then, you repeat the following process over and over:

  1. choose one of the control points at random
  2. move halfway toward whichever control point you chose, and plot a point
  3. this point becomes your new starting point
  4. return to step 1.

If the process is repeated fewer than, say, a hundred times, there it will not be easy to see a pattern. However, as several hundred points are plotted, a pattern begins to emerge. This pattern is an approximation to a fractal known as the Sierpinski Gasket (which is where the program got its name). A few thousand points will give a good idea of what the Sierpinski gasket looks like. Here's an example with ten thousand points plotted:
(In this picture, the chosen starting point was above and to the left of the line segment joining the red and green control points.)

There are many things that can be done to alter the process described above to get different final images. For example, instead of moving halfway to the selected point every time, we could move some other fraction of the distance. We could also vary the probability of choosing each point, so that, for example, one point would be chosen twice as often as the others. Here's the same run as above, except with the red point chosen twice as often as either the blue or the green point:

Iterate your knowledge...

Now that you know what Gasket does, you may want to learn


Return to the Help Index.