Logo by Transdimensional - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Did you know ? you can use LaTex inside Postings on fractalforums.com!
 
*
Welcome, Guest. Please login or register. April 25, 2024, 06:13:48 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Koch random snowflake  (Read 376 times)
0 Members and 1 Guest are viewing this topic.
Matplotlib
Forums Freshman
**
Posts: 13



WWW
« on: May 21, 2017, 10:30:01 PM »

A new way to generate the famous Koch snowflake is to make it random ! The principle is very simple, as many geometrical fractals :


Fig. 1 : The main pattern

Segment [AB] is the edge that has the pattern applied.
Place C on edge [AB] such that AC=offset*AB (offset ranges from 0.25 to 0.75).
Then, place D and F on [AB] such that CD=CF=radius*min(AC,BC) (you wouldn't want the circle to place points outside the edge. Or would you ? Here, radius ranges from 0.25 to 0.75 as well).
At last, place E such that CE=CD=CF and (CF,CE)=angle (here, angle ranges from pi/6 to 5pi/6).
New shape [A,D,E,F,B] gives you four edges where to apply the recursive pattern.
offset, radius and angle are chosen at random for each recursive call !

I ran the program with 7 iteration levels on all three edges of an equilateral triangle (I picked 1,j and j² the cubic roots of unity), and got this :


Fig. 2 : The random Koch Snowflake

It looks like an ordered Brownian motion !

Then, just to try, I ran the program (still with 6 recursive calls), but imposing offset=0.5, radius=0.5 and angle=pi/2 this time, and I got this :


Fig. 3 : "Almost" Koch's snowflake !

We're close, but not exactly matching the Koch's snowflake, as the triangle [DEF] is not equilateral even in this case. Hence, we get this image.


Just to let you work this out by yourself, I'm not going to show you what happens when you allow offset, radius and angle to range in a bigger interval. In my program, I defined each point with a complex number, and I defined points with complex formulas. Here they are, for those who wouldn't want to do this themselves :

A,B are complex.
C = offset*(B-A)+A
    r = radius*min(|B-C|,|A-C|) (the radius, a real number)
D = (r/|C-A|)*(A-C)+C
F = (r/|C-B|)*(B-C)+C
E = eangle*i(F-C)+C
Logged

Pages: [1]   Go Down
  Print  
 
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.153 seconds with 24 queries. (Pretty URLs adds 0.008s, 2q)