von Koch Curve | Lab Report |

**Purpose
**The purpose of this project is to show how to create a von
Koch curve, including a von Koch snowflake.

**Mathematical Background**

Swedish mathematician Helge von Koch introduced the "Koch curve" in 1904. Starting with a line segment, recursively replace the line segment as shown below:

0 | |

1 |

The single line segment in Step 0, is broken into four equal-length segments in Step 1. This same "rule" is applied an infinite number of times resulting in a figure with an infinite perimeter.

Here are the next few steps:

2 | |

3 | |

4 | |

... |

If the original line segment had length L, then after the first step each
line segment has a length L/3. For the second step, each segment has a length L/3^{2},
and so on.

After the first step, the total length is 4L/3. After the second
step, the total length is 4^{2}L/3^{2}, and after the k^{th} step,
the length is 4^{k}L/3^{k}. After each step the length of the curve
grows by a factor of 4/3. When repeated an infinite number of times, the perimeter
becomes infinite. For a more detailed explanation of the length computation, see [Peitgen92B, p. 107] or Eric Weisstein's World of Math.

For the von Koch "snowflake," start with an equilateral
triangle, and apply the "rule" above to each of the line segments. Assume
each side of the equilateral triangle is *a* units long. The area of this
equilateral triangle can be computed by breaking it into two 30-60-90 triangles:

The height of one of these two triangles is and the base is . So, the
area of the equilateral triangle (two 30-60-90 triangles) is . In each step *k*, we add the area of n_{k}
little equilateral triangles with sides s_{k}. The area at step k can be
written:

Convince yourself that n_{1} = 3, n_{2} = 3·4, n_{3}
= 3·4·4, ..., and n_{k} = 3·4^{k-1}. The sides of the little
triangles are scaled down by a factor of 3 in each step, i.e., s_{k} = (1/3)^{n}a.
The area recurrence formula can now be written:

The total area can be computed by evaluating the geometric series formed by the above recurrence formula. The total area after an infinite number of steps is

For a more detailed explanation of the area computation, see [Peitgen92B, p. 167] or Eric Weisstein's World of Math.

In summary, the von Koch snowflake has an infinite perimeter, but a finite area!

The von Koch curve has a self-similarity, Hausdorff dimension, D = log 4/ log 3 = 1.2619. (A line is 1D and a square is 2D). See [Peitgen92A] or [Devaney89].

The "modified" Koch curve [Falconer90, pp. 120-121] uses a rectangle in each iteration instead of a triangle. (The height of the rectangle is the same as the height of the triangle in Step 1 above.)

Feel free to experiment with other "rules."

Also see *Experiments
in Computing: Laboratories for Introductory Computer Science in Turbo
Pascal* by Kenneth Abernethy and J. Thomas Allen, Jr., PWS-Kent
Publishing, Boston, 1993, Chapter 20, Recursion in Fractal Geometry.
The Koch Snowflake Curve, pp. 342-348; Generalized Snowflake Curves, pp.
349-350.

**Materials and Equipment**

Software RequirementsWindows 98

Delphi 4/5 (to recompile)

KochCurve.EXE

Hardware RequirementsVGA display with 640-by-480 screen in high/true color display mode

**Procedure**

- Double click on the
*KochCurve.EXE*icon to start the program. - Select various values in the spinboxes at the left and immediately observe a new von Koch curve on the screen.
- Select the
*Print*button to print the currently displayed von Koch curve (perhaps in greater detail since many printers have many more dots than a display screen does). - To write a file to disk, select the bitmap size, and the press the
*Write to File*button. A save dialog will let you write this file anywhere you want.

**Discussion**

(Outline for now)

ScreenKochCurve unit and form:

- DrawVonKoch method

- ButtonPrintVonKochClick

- ButtonVonKochFileClick

- ShellExecute to link to web site

VonKochCurveLibrary unit (separates computations from user interface):

- TVonKochCurve Class with method Draw (draws on any canvas: screen, printer, or
bitmap)

- NextSegments (Local routine to Draw, which is called recursively. Since
NextSegments works with any line segment, the points making up the polygon are rotated
before this routine is ever called.)

MapWorldToPixel unit:

- TRealPoint, RealPoint

- TRealRect, RealRect

- TDigitalPantograph [for mapping real (x,y) to integer (i,j); "corrects"
direction of y-dimension]

**Conclusions
**Tell your friends: the von Koch snowflake has an infinite perimeter,
but a finite area! What does that really mean?

**Keywords**

von Koch curve, von Koch snowflake, fractals, self-similarity, Hausdorff dimension,
digital pantograph, world-to-pixel mapping, recursion

**Download
**Delphi 4/5 Source and EXE: VonKoch.ZIP
(201 KB)

Turbo Pascal 7 Source and EXE: Koch.ZIP

Note: If you have a fast machine (233 MHz Pentium II or faster), you'll likely need
a patch to run this TP 7 programs.

See this fix for
"Runtime Error 200" for Turbo Pascal.

**Future**

Add *FormResize *handler.

**Links: **(Also see Fractals and Chaos Section of *efg's* Mathematics
Reference page)

Chaos Theory: A Brief Introduction http://www.imho.com/grae/chaos/chaos.html |

Fractal Geometry: A Simple Explanation www.ncsa.uiuc.edu/Edu/Fractal/Fgeom.html |

Fractals and Fractal Geometry http://library.thinkquest.org/3493/noframes/fractal.html |

Koch's Flakes in "Fractals Polyhedra,
Flakes & L-trees" www.people.nnov.ru/fractal/VRML/3dLsys/3Dtree.htm |

"Koch Snowflake" from Eric Weissteins's World of
Mathematics http://mathworld.wolfram.com/KochSnowflake.html |

Snowflake Curve www.scidiv.bcc.ctc.edu/Math/Snowflake.html |

**References: **

[Devaney89] | Robert L. Devany and Linda Keen (editors)Chaos and Fractals -- The Mathematics Behind the Computer GraphicsFigure 2, p. 114, Hausdorff dimension American Mathematical Society, 1989. |

[Falconer90] | Kenneth FalconerFractal
Geometry: Mathematical Foundations and ApplicationsExample 9.5, Modified von Koch Curve, pp. 120-121 John Wiley & Sons, 1990. |

[Peitgen92A] | Heinz-Otto Peitgen, Hartmut Jürgens, Dietmar SaupeChaos and
Fractals -- New Frontiers of ScienceSection 2.4, The Koch Curve, pp. 89-93 Springer-Verlag, 1992 |

[Peitgen92B] | Heinz-Otto Peitgen, Hartmut Jürgens, Dietmar SaupeFractals for
the ClassroomSection 3.2, Geometric Series and the Koch Curve, pp. 164-170 Springer-Verlag, 1992 |

Updated | 14 Jun 2009 |

Since | 9 Apr 2000 |