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
    Have you seen this, or searched for "Koch" on this site for other such threads? – J. M. is computer-less Mar 19 '17 at 0:46
  • I got a lot of useful links by entering "mathematica koch snowflake" in google. – m_goldberg Mar 19 '17 at 4:00
  • On the user interface side of your question, it would help a lot if you were to give more details on how you want the user to interact with your snowflake drawing code. Mathematica has a function ClickPane that 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 the Manipulate function. – m_goldberg Mar 19 '17 at 4:07
  • What is the question? How to generate Koch snowflake, what parameters should it take? It rather sounds like a question about how to create a new primitive having the object, do you have it then?, if so then you can use 27184. Or maybe you the main question is the interactivity? Could you make a clear question and add what you have/have tried? – Kuba Mar 19 '17 at 16:06

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]

enter image description here

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.