A bit of Math Bytes code


Sierpinski Carpet

We will create a Sierpinski Carpet using an image. You may upload your own image:

Otherwise, the following image will be used when you press the generate button.

Please input the number of levels of a Sierpinski Carpet you'd like to make with this image.

Want to learn more about the math behind making candy mosaics? Read Math Bytes: Google Bombs, Chocolate-Covered Pi, and Other Cool Bits in Computing by Tim Chartier or click the image below for more information. Want to explore more mathematical ideas using interactive web applications? Consider registering for Tim Chartier's free MOOC that will explore topics in computer graphics and data mining, click the image to the right below to learn more and register.