Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.txt Creating a Snowflake Fractal in Python using Koch Curve Dec 5, 2017
koch Previous code gave error= "speed" is not defined Dec 15, 2019


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.

How to construct one:

Step 1:
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 draw
ing the snowflake. It's best if the length of the sides are divisible by 3, because of the nature of this fractal. This will become clear
in the next few steps.

Step 2:
Divide each side in three equal parts. This is why it is handy to have the sides divisible by three.

Step 3:
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 

Step 4:
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.

Step 5:
Draw an equilateral triangle on each middle part. Note how you draw each next generation of parts that are one 3rd of the mast one.

Step 6:
Repeat until you're satisfied with the amount of iterations. It will become harder and harder to accurately draw the new triangles, but 
with a fine pencil and lots of patience you can reach the 8th iteration. The one shown in the picture is a Koch snowflake of the 4th 

Step 7:
Decorate your snowflake how you like it. You can colour it, cut it out, draw more triangles on the inside, or just leave it the way it is.

Reference Links:
You can’t perform that action at this time.