Construction
The construction of the Sierpinski carpet begins with a square. The square is cut into 9 congruent subsquares in a 3-by-3 grid, and the central subsquare is removed. The same procedure is then applied recursively to the remaining 8 subsquares, ad infinitum. The Hausdorff dimension of the carpet is log 8/log 3 ≈ 1.8928.
The area of the carpet is zero (in standard Lebesgue measure).
The Sierpinski carpet can also be created by iterating every pixel in a square and using the following algorithm to decide if the pixel is filled. The following implementation is valid C, C++, and Java.
/** * Decides if a point at a specific location is filled or not. This works by iteration first checking if * the pixel is unfilled in successively larger squares or cannot be in the center of any larger square. * @param x is the x coordinate of the point being checked with zero being the first pixel * @param y is the y coordinate of the point being checked with zero being the first pixel * @return 1 if it is to be filled or 0 if it is open */ int isSierpinskiCarpetPixelFilled(int x, int y) { while(x>0 || y>0) // when either of these reaches zero the pixel is determined to be on the edge // at that square level and must be filled { if(x%3==1 && y%3==1) //checks if the pixel is in the center for the current square level return 0; x /= 3; //x and y are decremented to check the next larger square level y /= 3; } return 1; // if all possible square levels are checked and the pixel is not determined // to be open it must be filled }Read more about this topic: Sierpinski Carpet
Famous quotes containing the word construction:
“No real vital character in fiction is altogether a conscious construction of the author. On the contrary, it may be a sort of parasitic growth upon the authors personality, developing by internal necessity as much as by external addition.”
—T.S. (Thomas Stearns)
“Theres no art
To find the minds construction in the face:
He was a gentleman on whom I built
An absolute trust.”
—William Shakespeare (15641616)
“When the leaders choose to make themselves bidders at an auction of popularity, their talents, in the construction of the state, will be of no service. They will become flatterers instead of legislators; the instruments, not the guides, of the people.”
—Edmund Burke (17291797)