Sierpinski Carpet Fractal


If you can read this, then your browser is not set up for Java. . .

This applet generates a Sierpinski carpet. If you look at the Java source code you will see that it generates a random number, and then with probability 1/8 does the following:

The key omission, in order to create the Sierpinski carpet holes, is that zero probability is assigned to the possibility

Xnew = X/3 + .3333333333333333;
Ynew = Y/3 + .3333333333333333;
This omission creates a hole at each smaller level of the carpet.

Here is the java source code.