The Koch Snowflake is a fractal built from three copies of
the Koch curve. Once your draw_koch()
function works
correctly, write a new function draw_snowflake(length,
generation)
. Here is a picture of the Koch snowflake
with different colors to illustrate how the snowflake is
really just an equilateral
triangle that uses a Koch curve for each of its sides:
lab8-snowflake.png
This should be
a relatively simple function to write – there is no
recursion. All you need to do is call your draw_koch()
function for each of the three sides, turning after each curve is
drawn.
Here are Koch snowflakes for generations 0, 1, 2, and 3:
lab8-snowflake4.jpg
Once you have your Koch snowflake working, experiment with adding color. Consider making a drawing with snowflakes of different sizes, colors, having some filled with color too.
You can take a separate screenshot and upload to Gradescope along with the other files you are submitting.