I finished the koch snowflake (question 3 of Assignment 1) today.
I was really pleased with my algorithm, as it is very simple and has no special cases.
I did not use trigonometry, so I did not need to worry about quadrants etc.
Very beautiful structure; both the output and the code.
I then played around, and tried out variations.
Here are three different experiments for your amusement.
The first one was done by simply inverting the direction of triangle. Instead of opening outwards, it opens inwards. I provide the case for n=0,n=1,n=2 and n=4.
The second example was done by instead of creating perfectly equilateral triangles, each time it creates a slightly longer isosceles triangle. I provide the case for n=0,n=1,n=2 and n=8 (the most pretty – it looks like a buddhist mandala!)
Finally in the third I used the Koch snowflake but I interlaced two large green ones and then put two smaller ones inside.
Beautiful images, hey! What a fun course!