Thursday, 31 May 2018

Coding for the Koch Snowflake


Problem description: Start an equilateral triangle with sides of length =1 . At each iteration, we divide each side into 3 equal parts, construct an equilateral triangle on the middle part, and delete the middle part.My attempt: I know the idea is that the code is supposed to take in 2 points and output 3 points for each side. The problems I've run into are that when I tried to tackle this from a vertex perspective, I get really bad points and the program doesn't work. I know I probably have to tackle it with vectors BUT the problem is that I've never been taught any of the vector functions in matlab. Is there any simple way to tackle this issue?

No comments:

Post a Comment