Tag Archives: Featured

Bonus Friday Post (Fractals You Can Build)

Thanks to all of you who have been following Fractal Week! Today I’ll show you how to make a 3D Sierpinski triangle made from nothing but toothpicks and mini-marshmallows! Plus we have a comic from guest artist Brian Buckley!

First stage, base of one of the four pyramids that make up the full size triangle. Our cat Dax is already curious.

Build pyramids in the three corners, leaving the middle open. Some left-over fuel to the left.

A complete mini-pyramid. The full size pyramid is made up of four of these, three for the base and one on the top. We built the base a few days ahead of time allowing it time to harden. (The Little Red Haired Girl also suggested reinforcing it with hairspray which seems to have done a good job).

The final product with one of my wife’s birthday gifts to me guiding the final construction.

View from one side, as you can see the whole middle section is removed, as it would be in the real triangle. It may come as a surprise to some of you, but Fractals with parts removed are not the most stable, hence why we reinforced it.

Most 3D Sierpinski’s I’ve seen are computer generated and have four sides. I felt this wouldn’t work for our shape for two reasons. One triangles, even ones with parts removed are stronger than squares. And two, this shape has a Sierpinski triangle on all sides, even the base.

Several hundred toothpicks and about half a bag of mini-marshmallows went into the construction of this fractal (some to fuel the builder).

The view from inside.

Friend of the blog Brian Buckley was kind enough to draw another “versus” picture for this week.

Have a great weekend, we’ll be back to regularly scheduled programming next week.

The Fractals You Can Draw posts are collected in ebook form, available now on Amazon.

1 Comment

Filed under Uncategorized

Fractals You Can Draw (The Hilbert Curve or What The Labyrinth Really Looked Like)

Our last fractal of the week is the Hilbert Curve, a variation of the Peano curve first described in 1891. While this is our oldest fractal of the week, its uses and derivation have implications in modern technology and modeling.

Drawing the Hilbert curve is best learned by seeing the various stages:

Initial Stage:

This is the start of our Hilbert curve or its Axiom (a term we’ll come back to late). The second stage is as follows:

Stage 2:

Each stage of the Hilbert curve is a construction of three rotations:

1) Make a mirror image of our initial stage to the right of our first stage (there’s a gap between each new section which we’ll get to in a moment).

2) Make a copy of our left object and rotate it counter-clockwise 90 degrees.

3) Make a copy of our right object and rotate it clockwise 90 degrees.

You now have four u shapes with a gap between them equal to the length of one of their line segments. Rather than leaving these objects separate, we connect the four shapes with three new lines.

This is repeated for each stage:

Stage 3:

As you can see Stage 3 contains 4 copies of Stage 2.

Stage 4:

Stage 4 contains 4 copies of Stage 3.

Here’s a drawing of Stage 5:

Hilbert Curve (Hand-Drawn)

Hilbert Curve (Hand-Drawn)

The easiest way to draw the Hilbert curve is to keep a copy of the previous stage on another sheet of paper.

The Hilbert Curve has a Fractal dimension of 2 like the Dragon Curve and has some interesting properties. At Stage 6 (below), the curve is constructed of 4095 segments of equal length contained in an area 128 lengths by 128 lengths. This means that the length of the curve is 32 times greater than one side of the square containing it.

This kind of compression is practical in antennae construction. The longer the antennae the weaker the signal you can pick up. Curves like the Hilbert curve allow for lines of incredibly long length to be confined in a small area.

Going Deeper (L-Systems):

I have a confession to make. There’s an easier way to construct the Hilbert curve (with the aid of computers) using a technique called Lindennmayer Systems (L-Systems for short). L-Systems are an algorithmic way of describing the formation of an object, and is used in plant modeling, as well as being able to make all of the fractals we’ve drawn this week.

There are three parts to an L-System, the axiom, the instructions, and the translation rules.

The axiom is a string of characters that describe the initial state of the fractal. For the Hilbert curve the axiom is the following:

Axiom: A

For each L-System there are a set of characters that provide drawing instructions. Typically ‘F’ means draw a line forward, ‘+’ means rotate left and ‘-‘ means rotate right. There are other characters that make up the Axiom and the rules that dictate the growth of the shape, but are disregarded once drawing begins.

To draw the Hilbert curve there are two rules:

A → – B F + A F A + F B –

B → + A F – B F B – F A + 

In this case we rotate 90 degrees with every turn. To use an L-System start with the axiom and apply any rules that apply. In this case we get:

– B F + A F A + F B –

If we stop here and remove all characters that are not instructions we get the following:

-F+F+F-

Which draws our initial stage:

If however we apply the translation rules one more time, the resulting string is:

+ A F – B F B – F A + F + – B F + A F A + F B – F – B F + A F A + F B – + F + A F – B F B – F A + –

If we again strip all non-instructions we get:

-+F-F-F+F+-F+F+F-F-F+F+F-+F+F-F-F+-

Which draws our second stage.

Let’s try another one for the Sierpinski Triangle:

Axiom: A

A → B−A−B

B → A+B+A

In this case we rotate 60 degrees with every turn, and A and B are both used to mean draw a line forward. Here’s what we get after 2,4,6 and 8 stages:

Koch Curve L-System:

Axiom : F++F++F

F → F−F++F−F

Use 60 degree turns. Result after 4 iterations:

Dragon Curve L-System:

Axiom: FX

X → X+YF

Y → FX-Y

Use 90 degree turns. Result after 10 iterations.

Other L-Systems:

Quadratic Fractal:

Axiom: F+F+F+F

F→ F+F-F

Use 90 degree turns. Result after 4 iterations.

Koch Curve Variant:

Axiom = F

F → F+F−F−F+F

Use 90 degree turns, result after 6 iterations:

Fractal Plant:

Axiom: X

X → F-[[X]+X]+F[+FX]-X

F → FF

Use 25 degree turns. When you encounter a ‘[‘ save the current angle and position and restore when you see ‘]’. This is an example of a recursive L-System. Result after 5 iterations:

All of the above images were generated using C++ code, rendered to SVG then converted to PNG. There are more L-Systems than I can list here, but all follow the same basic construction rules.

*Whew!* Lot to cover today, but hope it was fun. Feel free to leave any questions in the comments section. Tomorrow we’ll take a look at some non-conventional fractal construction methods.

Want some fractals you can color? You might like my new Adult Coloring Book: Fractals.

11 Comments

Filed under Uncategorized

Fractals You Can Draw (The Dragon Curve or The Jurassic Fractal)

For Day Three of Fractal Week we have our youngest fractal, first described in the mid-sixties. This fractal curve goes by many names “The Harter-Heighway Dragon”, “The Dragon Curve” or “The Jurassic Park Fractal”. This last name refers to this fractal’s most well known appearance, on the section title pages in the book Jurassic Park, iterating a little more in each section. This is also probably the toughest fractal to draw this week, and also features our guest artist “The Little Red-Haired Girl.”

Step One: Draw a line. Rotate a copy of this line 90 degrees (clockwise) and attach it to the end of the first line.

The black line is our starting place, and the red line is the line we’ve rotated.

Step Two: We now have an L shaped line. Rotate a copy of this ENTIRE line 90 degrees, and attach it to the end as in Step 1.

The number of lines it takes to draw this fractal doubles with each iteration. It is important to always rotate a copy of the entire previous shape and attach it to the end of the previous iteration.

Step Three: We now have a backwards question mark. Rotate a copy of this ENTIRE line 90 degrees, and attach it to the end of the previous step.

Hopefully now you’re beginning to get the idea. This next iteration is where it gets a bit tricky.

Step Four: Repeat Step Three for the ENTIRE new line we’ve constructed.

As you can see our rotated segment intersects with the previous step to form a box. While the Dragon Curve never crosses itself, there are a number of intersections like the one in this step.

Step Five: Repeat Step Three for the ENTIRE new line we’ve constructed.

By five iterations we’re starting to get an idea of the whole shape. As in all of the previous drawings, the section in red is the rotated copy, and the black is the previous stage. Let’s see a couple more iterations:

Step Six: Repeat Step Three for the ENTIRE new line we’ve constructed.

Step Seven: Repeat Step Three for the ENTIRE new line we’ve constructed.

Here’s a drawing with two more repetitions or iterations (Stage 9 of the fractal, mirror image):

Dragon Curve (Hand-Drawn)

Dragon Curve (Hand-Drawn)

This fractal turned out to be very difficult to draw because of the number of times it curves back on itself. While the final product took only about 20-30 minutes to draw, both of us took a crack at it for hours. Two things are important in trying to do this yourself.

1) Draw the new stage in a different color or on a different piece of paper to always have the previous shape as a reference.

2) Remember you are rotating the entire previous step, and always attaching it to the end (like uncurling a ribbon). You want to maintain the same rotation and direction.

Here’s a couple more iterations using a computer:

13 Iterations:

16 Iterations:

Going Deeper (Dimension and Self-Similarity)

The Dragon Curve is an example of a space-filling curve and has a fractal dimension of 2. This essentially means the dragon fractal is a shape, a 2D object, despite the fact it is a curve that never crosses itself and does not meet at the ends.

Also, as you can see from our illustrations above, each new stage of the fractal contains two copies of the previous stage. This is a slightly different kind of self similarity to the Sierpinski Triangle and Koch Snowflake, which look exactly the same no matter how far you zoom in.

Observe on the Koch Snowflake (image source: Wikipedia):

The Dragon curve, while not being exactly the same at all resolutions, still is constructed from previous iterations, and maintains the same basic shape.

Sidebar: Jeff Goldblum’s character in the movie Jurassic Park is a mathematician who specializes in Chaos Theory, related to the Chaos Game we played on Monday. While the Dragon Curve is a good choice for a book about dinosaurs, it is completely deterministic and not chaotic at all. The dragon will always be the same at various iterations. The Chaos Game, on the other hand, yields slightly different results each time, which resolve to the recognizable shape of the Sierpinski Triangle.

One more Fractal to go, our oldest fractal, The Hilbert curve. Any questions?

Want some fractals you can color? You might like my new Adult Coloring Book: Fractals.

13 Comments

Filed under Uncategorized

Fractals You Can Draw (The Koch Snowflake or Did It Really Snow In Cleveland In Late April?)

kochSnowflake400_1

Our next fractal is the Koch Snowflake, based on the Koch curve, one of the first fractals ever described. The techniques used to construct the snowflake are similar to the ones used to measure coastlines, and will also provide us our first foray into fractal dimensions. The artist for this fractal is none other than “The Little Red-Haired Girl” who volunteered to draw several of the fractals you’ll see this week.

Step One: Draw a triangle (typically equilateral).

Koch Snowflake Initial Stage

Step Two: Divide each side into thirds. Remove the middle third, and draw two sides of an equilateral triangle above the removed segment (connected to the other two). In other words, add a peak where the line used to be.

Koch Snowflake Second Stage

Step Three: Repeat step two on each side of the new shape (12 sides).

kochSnowflakeLSysL2Tri

The overall shape now has 48 sides.

If we repeat the process one more time we’d get a shape with 192 sides. The drawing below takes this one more step, or iteration. It took about 3 hours to complete:

Koch Snowflake (Hand-Drawn)

Koch Snowflake (Hand-Drawn)

Like the Sierpinski the process is simple, but after a few repetitions we get an intricate snowflake.

Going Deeper (Fractal Dimension)

Let’s consider one side of the original triangle. Is it a line, which is 1 dimensional, or a shape which is 2 dimensional? What is the length of the Koch curve?

The length of the Koch curve increases by four-thirds after each iteration. That’s because we divide the original line into thirds, and add two lines equal to one-third of the original line, while removing a third of the original. We start with one line and end up with four, each one-third the length of the original line. This means as the series goes to infinity the length of the line is continuously increasing, and is considered infinite in length. Somehow, calling it 1D doesn’t seem quite right.

But it’s not a shape either, in curve or snowflake form. Hence fractal dimensions.

The basic formula for a shape like the Koch curve is this:

D = log(N) / log(1/r)

N = the number of lines relative to the previous iteration. In this case N is 4.

r = the ratio of each line segment to the previous iteration. In this case r is 1/3.

So the dimension of the Koch curve or snowflake is log(4)/log(3) or ≈1.2619.

Basically, fractal dimensions describe the relationship of previous iterations to the current one, and attempt to otherwise evaluate the degree of complexity of the iterated process. Though it would be difficult, the Koch curve can be drawn as a single line, without lifting your pencil, and without connecting the two ends. So it is a line, but an infinitely long line with self-similarity.

Fractal dimensions are a little hard to understand, but make a bit more sense when we get into space-filling curves like the Dragon and Hilbert curves.

Here’s another variant of the Koch curve, this one done with right angles:

kochCurveLSysL1

We start with a straight line; divide it in thirds and draw a square in the middle third, removing the bottom side. For this we’d have N = 5, 5 new lines after each iteration, with r = 1/3, since each line segment equals 1/3 of the original. Hence our fractal dimension is log(5) / log(3) ≈1.4649.

Here are the next few stages of the fractal:

As you can see this fractal does seem to take up more area than the snowflake up above, hence the higher dimension. Some fractals have a dimension of 2 which makes them essentially shapes, yet shapes that are constructed from curves that bend back on themselves.

Want some fractals you can color? You might like my new Adult Coloring Book: Fractals.

5 Comments

Filed under Uncategorized