2/13/2015

Start with a line segment (depth 0) *Divide the line into thirds *In the middle third produce an equilateral triangle * Then remove the base

Koch Snowflake How to draw a Koch snowflake.

The Koch Snowflake  The Koch Snowflake was studied by Niels Fabian Helge von Koch (25 Jan 1870 - 11 March 1924), a Swedish mathematician and nobility.

The Koch Curve

This gives Depth 1

Repeat the process for each of the line segments

•The Koch Snowflake, which starts with an equilateral triangle, consists of three Koch curves. •The snowflake is self-similar. This means that it is roughly the same on any scale. •If you were to magnify any part of the snowflake it would look the same.

1

2/13/2015

This gives Depth 2

Repeating the process again for each line segments gives Depth 3

Starting with an equilateral triangle produces the Koch Snowflake

How to draw a Koch snowflake by Computer? P2 P1

P3

DrawKochSnowflake(Integer: depth, Float: length) P1 = (0, 0) P2 = (length/2, length*sqrt(3)/2) P3 = (length, 0) DrawKoch(depth, P1, 60, length) DrawKoch(depth, P2, -60, length) DrawKoch(depth, P3, 180, length) End DrawKochSnowflake DrawKoch(Integer: depth, Point: pt1, Float: angle, Float: length)

This iterative process can be repeated again and again and again….. Below is Depth 4

How to draw Koch snowflake by Computer? pt3 pt1

pt2

pt4

DrawKoch(Integer: depth, Point: pt1, Float: angle, Float: length) If (depth == 0) drawLine(pt1, angle, length) Else DrawKoch(depth-1, pt1, angle, length/3) DrawKoch(depth-1, pt2, angle+60, length/3) DrawKoch(depth-1, pt3, angle-60, length/3) DrawKoch(depth-1, pt4, angle, length/3) End If End DrawKoch Run Time: T(n) = 4T(n-1)+O(1)  T(n) = O(n4)

2

2/13/2015

Questions: Given a Koch Snowflake of depth n and initial length S

Number of Sides We end up with a series: Nn ={3, 12, 48…}

• What is the length of each line segment? • How many line segments? • What is the total area inside the snowflake?

The common ratio then is four, and since we started with three sides, the series begins with three. The formula is thenNn=(3)(4)n n= depth, the iteration number N0 =3

Length of Sides

N1 =12

N2=48

Common Sense

Observation: each iteration is (1/3) of the length before it. Let’s say that the equilateral triangle starts with a length of S=3 and n=depth. L0 =3→this is the side of original triangle L1 =1 L2 =1/3 Ln ={3, 1, 1/3, 1/9, 1/27…} The ratio of this series is (1/3)

If we know the length of each side, and the total number of sides, we can also determine the formula for the perimeter of the Koch snowflake!

We get the formula: Ln= (1/3n)S

Number of Sides  Like the length of the sides, the number of sides for the snowflake is also a geometric series.  The snowflake always starts with three sides. When we make the first iteration, as shown in the picture, we have 12 sides now.  The second iteration shows 48 sides if we count it.

Perimeter of a Koch Snowflake We already knew these two formulas: Nn=(3)(4)n Ln= S(1/3)n The perimeter of an object that has equal sides, is always the total number of sides times the length. This means: Pn= Nn Ln Pn=3*S(4/3)n Again, if the side length is equal to 3, for P0 : P0= 3*3 (4/3)0=9 P1= 3*3 (4/3)1=12

3

2/13/2015

Infinity

Area with iterations: The first iteration:

Because we can continuously add more and more sides to the snowflake, the perimeter continues to get larger and larger. This means that the snowflake has a perimeter of infinite length! BUT…… We get the area of the initial triangle, plus the area of three more triangles with side lengths of (1/3) of S.

What about area??

2nd Iteration

Formula for Area It never exceeds the box area! The area of the snowflake is finite…the series converges! How does this happen? If we start with the area of a regular equilateral triangle we get this formula….

Each time you iterate it, we add (3)(4)n triangles of : and the following formula is the total area.

The area converges to:

4

2/13/2015

Other variations

Hilbert Curve

eg: use different length segments and add an isosceles triangle

 Each part of the larger curve is a copy of the smaller curve suitably scaled, rotated and connected.

OR divide the initial line segment into thirds and add another shape in the gap

The 2D Hilbert Curve (1891) A plane-filling Peano curve

Construction of 3D Hilbert Curve You could start with a polygon rather than a straight line

5

2/13/2015

Construction of 3D Hilbert Curve

 Use this element with proper orientation, mirroring.

Typical Early Solutions

Metal Sculpture at SIGGRAPH 2006

Design:  closed loop  maximal symmetry  at most 3 coplanar segments

Sierpiński Curve

Design Flaws:

 2 collinear segments  less than maximal symmetry

 Each part of the larger curve is a copy of the smaller curve suitably scaled and rotated

 4 coplanar segments

D. Garcia, and T. Eladi (1994)

Jane Yen: “Hilbert Radiator Pipe” (2000)

Sierpiński Curve Levels 0 - 3

Flaws

( from a sculptor’s point of view ):

 4 coplanar segments  Not a closed loop  Broken symmetry

6

2/13/2015

Sierpiński Gasket

(or sieve or triangle)  Divide an area into shapes  Recursively color some of the shapes

Sierpiński Carpet

All these figures can be drawn by simple recursive programs.

7