Draw a Fractal (Sierpinski Triangle)

a

b

c

x

y

z

triangle (a,b,c)
  draw lines ab bc ca
  x=mid(ab)
  y=mid(bc)
  z=mid(ca)
  triangle(x,y,z)

 

 

a

b

c

x

y

z

triangle (a,b,c)
  draw lines ab bc ca
  x=mid(ab)
  y=mid(bc)
  z=mid(ca)
  triangle(a,x,z)
  triangle(x,b,y)
  triangle(z,y,c)



triangle (a,b,c)
  draw lines ab bc ca
  x=mid(ab)
  y=mid(bc)
  z=mid(ca)
  triangle(x,y,z)

 

 

a

b

c

Sierpinski Triangle

By Dan Ryan

Sierpinski Triangle

  • 224