Welcome to Fractal Forums

Fractal Math, Chaos Theory & Research => (new) Theories & Research => Topic started by: Matplotlib on May 21, 2017, 10:30:01 PM




Title: Koch random snowflake
Post by: Matplotlib 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 :

(https://img4.hostingpics.net/pics/777278kochconstr.png)
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 :

(http://orig05.deviantart.net/f811/f/2017/141/5/2/random_koch_snowflake_by_matplotlib-db9zb4p.png)
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 :

(https://img4.hostingpics.net/pics/593108koch.png)
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