Thursday, January 19, 2012

Sierpinski Gasket



This fascinating pattern is created by the following steps:
  1. Pick 3 vertices for a triangle
  2. Assign a color for each vertex (In this case, red, green and blue)
  3. Pick an arbitrary point "p" that is inside the triangle, with an arbitrary color
  4. Pick, at random, one of the vertices. 
  5. Find the midpoint, "m", between "p" and the randomly picked vertex, along with the mid-point color
  6. Draw "m", and replace "p" with "m"
  7. Repeat from step 4

No comments:

Post a Comment