! Koch Curve #1

CLEAR

SET MODE "graphics"

SET WINDOW-.05, 1.05,-.05/1.33,1.05/1.33

!Note: If the "hat" has a side length of 1/3, the tip of the hat

!reaches a heigth h = (1/3)*sin60 = 0.333*0.866 = 0.288

PICTURE line1

PLOT 0,0;(1/3),0;.5,.288;(2/3),0;1,0

END PICTURE

DRAW line1

PAUSE 1

CLEAR

PICTURE line2

DRAW line1 with scale (1/3,1/3)

DRAW line1 with scale (1/3,1/3)*rotate(pi/3)*shift(1/3,0)

DRAW line1 with scale (1/3,1/3)*rotate(-pi/3)*shift(.5,.288)

DRAW line1 with scale (1/3,1/3)*shift (2/3,0)

END PICTURE

DRAW line2

PAUSE 1

CLEAR

PICTURE line3

DRAW line2 with scale (1/3,1/3)

DRAW line2 with scale (1/3,1/3)*rotate(pi/3)*shift(1/3,0)

DRAW line2 with scale (1/3,1/3)*rotate(-pi/3)*shift(.5,.288)

DRAW line2 with scale (1/3,1/3)*shift (2/3,0)

END PICTURE

DRAW line3

PAUSE 1

CLEAR

PICTURE line4

DRAW line3 with scale (1/3,1/3)

DRAW line3 with scale (1/3,1/3)*rotate(pi/3)*shift(1/3,0)

DRAW line3 with scale (1/3,1/3)*rotate(-pi/3)*shift(.5,.288)

DRAW line3 with scale (1/3,1/3)*shift (2/3,0)

END PICTURE

DRAW line4

PAUSE 1

CLEAR

PICTURE line5

DRAW line4 with scale (1/3,1/3)

DRAW line4 with scale (1/3,1/3)*rotate(pi/3)*shift(1/3,0)

DRAW line4 with scale (1/3,1/3)*rotate(-pi/3)*shift(.5,.288)

DRAW line4 with scale (1/3,1/3)*shift (2/3,0)

END PICTURE

DRAW line5

END