Sierpinski carpet

The Sierpinski carpet is a fractal that goes back to the Polish mathematician Waclaw Sierpiński. Of a square of the ninth surface is removed in the middle. From the remaining about the hole eight square fields per turn of the ninth surface is removed, and so on.

The fractal dimension of the Sierpinski carpet is; in particular is its area ( in Lebesgue measure ) zero.

The construction is very similar to the construction of the Cantor set, there is removed from a section of the central part, or the Sierpinski gasket, is removed at the center portion of a triangle. In three dimensions is derived from the construction of the Sierpinski carpet, the design of the Menger sponge.

Area

The area of ​​the (remaining) carpet can be represented as a result, it is assumed that the side length of the original square is 1, then for the explicit representation and for the recursive representation.

Computer program

The following Java applet draws a Sierpinski carpet using a recursive method:

* import java.awt. ; import java.applet *. ;   public class SierpinskiCarpet extends Applet {      private Graphics g = null;      private int d0 = 729; / / 3 ^ 6        public void init ( )      {          g = getGraphics ();          resize ( d0, d0);      }        public void paint ( Graphics g)      {          / / Start the recursion:          drawSierpinskiCarpet ( 0, 0, getWidth (), getHeight ());      }        private void drawSierpinskiCarpet (int Xol, Yol int, int width, int height )      {          if ( width > 2 && height- > 2)          {              int b = width / 3;              int h = height- / 3;              g.fillRect ( Xol b, Yol h, b, h);              for (int k = 0; k <9, k ) if ( k! = 4)              {                  int i = k / 3;                  int j = k % 3;                  drawSierpinskiCarpet ( Xol i * b, Yol j * h, w, h ); / / Recursion              }          }      } } Web Links

  • Fractal geometry
729590
de