Koch Snowflake
The Koch Snowflake is a fractal curve. The Antisnowflake is a variation.
This script uses recursion to construct the fractal.
Drawing is done using the turtle module.
Two Python functions are defined:
-
draw_koch_curve(length, recursion_depth, draw_anti_snowflake = False)
This function draws a Koch curve which is used for the sides of the snow flakes. It calls itself recursively to construct the fractal shape
-
draw_koch_snowflake(center_xy, length_side, recursion_depth, draw_anti_snowflake = False):
This function calls draw_koch_curve() three times to draw the snowflake