What is Koch Curve?
The Koch snowflake (also known as the Koch curve, Koch star, or Koch island) is a mathematical curve and one of the earliest fractal curves to have been described. It is based on the Koch curve, which appeared in a 1904 paper titled “On a continuous curve without tangents, constructible from elementary geometry” by the Swedish mathematician Helge von Koch.
The progression for the area of the snowflake converges to 8/5 times the area of the original triangle, while the progression for the snowflake’s perimeter diverges to infinity. Consequently, the snowflake has a finite area bounded by an infinitely long line.
Draw an equilateral triangle. You can draw it with a compass or protractor, or just eyeball it if you don’t want to spend too much time drawing the snowflake.
Divide each side in three equal parts. This is why it is handy to have the sides divisible by three.
Draw an equilateral triangle on each middle part. Measure the length of the middle third to know the length of the sides of these new triangles.
Divide each outer side into thirds. You can see the 2nd generation of triangles covers a bit of the first. These three line segments shouldn’t be parted in three.
Draw an equilateral triangle on each middle part.
Representation as Lindenmayer system
Alphabet : F
Constants : +, ?
Axiom : F
Production rules: F ? F+F–F+F
Here, F means “draw forward”, – means “turn right 60°”, and + means “turn left 60°”.
To create the Koch snowflake, one would use F++F++F (an equilateral triangle) as the axiom.
To create a Koch Curve :
To create a full snowflake with Koch curve, we need to repeat the same pattern three times. So lets try that out.
This article is contributed by Subhajit Saha. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- SciPy | Curve Fitting
- Python - Hilbert Curve using turtle
- Heighway's Dragon Curve using Python
- Cubic Bezier Curve Implementation in C
- Serializer Fields - Django REST Framework
- Minimum steps to make sum and the product of all elements of array non-zero
- Print all subsequences of a string in Python
- Maximum length prefix such that frequency of each character is atmost number of characters with minimum frequency
- Difference between JPEG and Bitmap
- Difference between Python and Java
- Difference between Python and C++
- File upload Fields in Serializers - Django REST Framework
- Creating and Using Serializers - Django REST Framework
- DictField in serializers - Django REST Framework