I am looking to create a user interface where the user can click on the screen and create a picture or pattern using Koch's snowflakes. To do this, I was hoping to write the recursive function necessary to generate the Koch's snowflakes, then create graphics objects out of these snowflakes. Is it possible to create graphics objects like this? Any help will be much appreciated! Thanks!
1 Answer
$\begingroup$
$\endgroup$
With 11.1 release you look into KochCurve. You can define all sorts of related fractal segment replacements. In case of snowflake you can define a function:
KochSnow[n_]:=
With[
{kc=KochCurve[n]},
{kc,
Rotate[kc,2Pi/3,{1/2,-(1/(2 Sqrt[3]))}],
Rotate[kc,-2Pi/3,{1/2,-(1/(2 Sqrt[3]))}]}
]
Then you make:
Graphics[KochSnow[#]] & /@ Range[6]

ClickPanethat will give a simple user interface where you can draw a Koch snowflake each time the user clicks in the pane. You might start with that. For more complex user interaction, you might want use theManipulatefunction. $\endgroup$