The Koch Snowflake Curve

The Koch curve belongs to a class of fractal objects labeled as "self-similar".  These objects are constructed in such a way that when you take a small portion of the object and scale it up appropriately, the original object appears again.  In nature the coastline of an island has this type of property. When we map the coastline, the inlets and peninsulas at one level of detail (perhaps on the scale of a mile) has the same level of "squiggliness" as the same map at the scale of a foot, for example.

To carry out the construction of the Koch curve we will use a "recursive" process.  Think of the mapping of a coastline as a process.  To carry out the mapping, perhaps we use a basic unit of measurement of a mile. With this ruler we measure the coast and get a length of 20 miles.  Now, let's think of starting the process over, but we want to refine our measurement to a scale of 1 yard. One way to do this would be to take our old data points (1 mile units) and for each such mile unit we carry out a new mapping process, subdividing our measurements into yards.  Thus, to get the total coastline length, we can think of the mapping process as a two stage process: To map the coastline, we map 1 mile units, but to map each 1 mile unit we need to carry out the mapping process again on a smaller scale of 1 yard.  This is the nature of a recursive process - to execute (carry out) the process as a whole requires us to execute the same process (usually on a smaller scale) as a sub-step within the execution of the process itself.

The recursive process in the construction of the Koch curve will be to take a segment (AB) and transform it into four sub-segments with a bend in the middle as shown below. We will do this by dividing the segment into three equal portions, adding a 60 degree turn, and connecting the new set of points.  This construction will then serve as a "template" for a recursive process that will be used to define the Koch curve.

Construction of Template Curve:
    To start our construction, open a new Recorder (Under the "File" menu) window and hit "Record."  To make the template proceed as follows:

This ends the construction of our basic template. We now want to apply this same template construction to each of the four smaller sub-segments that were constructed.  To do this, we need to have the same type of basis as was used in the original template, i.e. two points.  Proceed as follows:
To check that all is working right,  clear the canvas, plot two points, select them, and hit "FF" in the Recorder window.  A dialog box will pop up asking you for the level of recursion desired for playback. Type in "0" for no recursion and click "Okay". You should see the template that was just recorded played back on the two points selected.

Clear the screen again, plot two points, and hit "FF". This time choose a recursion level of 1. When the recording plays back this time, you will see the effect of the looping that was defined in the construction of the template. Try playing the recording on two points with a recursion level of 2.

Construction of Koch Snowflake Curve:

The snowflake curve is defined as the curve generated by playing back our template process on the three segments of a triangle.  To construct the snowflake curve, we first construct a triangle (A,B,C) on the canvas.  To playback the template on the three sides, we need to store three sets of vertices as a "basis" in the recorder.  Proceed as follows: