Koch curve
From Free net encyclopedia
Image:KochFlake.png Image:Koch curve.png
The Koch Curve is a mathematical curve, and one of the earliest fractal curves to have been described. It appeared in a 1904 paper entitled "Sur une courbe continue sans tangente, obtenue par une construction géométrique élémentaire" by the Swedish mathematician Helge von Koch. The better known Koch Snowflake (or Koch Star) is the same as the curve, except it starts with an equilateral triangle instead of a line segment. The Koch curve is a special case of the de Rham curve.
Eric Haines has developed the sphereflake fractal, a three-dimensional version of the snowflake.
One can imagine that it was created by starting with a line segment, then recursively altering each line segment as follows:
- divide the line segment into three segments of equal length.
- draw an equilateral triangle that has the middle segment from step one as its base.
- remove the line segment that is the base of the triangle from step 2.
After doing this once the result should be a shape similar to the Star of David.
The Koch Curve is in the limit approached as the above steps are followed over and over again.
The Koch Curve has an infinite length because each time the steps above are performed on each line segment of the figure there are four times as many line segments with the length of each one third the length of the segments in the previous stage. Hence its length increases by one third and the length at step n will be (4/3)n and the fractal dimension is log4/log3 =~1.26 (bigger than the dimension of a line {1} but smaller than Peano's Space-filling curve {2}).
The Koch Curve is continuous, but not differentiable anywhere.
The area of the Koch Snowflake is 8/5 that of the initial triangle, so an infinite perimeter encloses a finite area.
L-System Definition
The Koch Curve can be completely described as an Lindenmayer System using the following definition:
Angle: π/3 (60°) Axiom: F Rules: F → F-F++F-F
In addition, the Koch Snowflake can be defined as follows:
Angle: π/3 (60°) Axiom: F++F++F Rules: F → F-F++F-F
Implementation
Here follows a sample implementation of the Koch Curve for a Turtle robot written in a Logo-like language. It can be tried out online with Web Turtle. Change the value of A in the first line to any number from 1 to 5 to see the different levels of complexity.
LET A 5 ; calculate adjusted side-length LET B 243 REPEAT A LET B B/3 NEXT ; place pointer POINT 150 MOVE 140 POINT 0 ; start GO SIDE RIGHT 120 GO SIDE RIGHT 120 GO SIDE ; finished. END ; main loop # SIDE GO F LEFT 60 GO F RIGHT 120 GO F LEFT 60 GO F RETURN ; forward # F IF A > 1 ; go deeper depending on level LET A A-1 GO SIDE LET A A+1 ELSE ; or just do a single line DRAW B ENDIF RETURN
External links
- More discussion and helpful pictures
- A few famous fractal curves (L-System fractals)cs:Kochova křivka
de:Koch-Kurve es:Copo de nieve de Koch fa:برخال کخ fr:Flocon de Koch he:פתית השלג של קוך ko:코흐 곡선 it:Curva di Koch ja:コッホ曲線 pl:Krzywa Kocha pt:Curva de Koch ru:Кривая Коха sr:Кохова пахуља sl:Kochova snežinka sv:Von Kochs kurva