Curvous Energy

Here is a strange and beautiful fractal known as a dragon curve:

A dragon curve (note: this is a twin-dragon curve or Davis-Knuth dragon)


And here is the shape generally regarded as the dullest and most everyday of all:

A square


But squares are square, so let’s go back to dragon-curves. This particular kind of dragon-curve looks a lot like a Chinese dragon. You can see the same writhing energy and scaliness:

Chinese dragon


Dragon-curve for comparison


Dragon-curves also look like some species of soft coral:

Red soft-coral


In short, dragon-curves are organic and lively, quite unlike the rigid, lifeless solidity of a square. But there’s more to a dragon-curve than immediately meets the eye. Dragon-curves are rep-tiles, that is, you can tile one with smaller copies of itself:

Dragon-curve rep-tiled with two copies of itself


Dragon-curve rep-4


Dragon-curve rep-8


Dragon-curve rep-16


Dragon-curve rep-32


Dragon-curve self-tiling (animated)


From the rep-32 dragon-curve, you can see that a dragon-curve can be surrounded by six copies of itself. Here’s an animation of the process:

Dragon-curve surrounded (anim)


And because dragon-curves are rep-tiles, they will tile the plane:

Dragon-curve tiling #1


Dragon-curve tiling #2


But how do you make these strange and beautiful shapes, with their myriad curves and curlicules, their energy and liveliness? It’s actually very simple. You start with the shape generally regarded as the dullest and most everyday of all:

A square


Then you see how the shape can be replaced by five smaller copies of itself:

Square overlaid by five smaller squares


Square replaced by five smaller squares


Then you set about replacing it with two of those smaller copies:

Replacing squares Stage #0


Replacing squares Stage #1


Then you do it again to each of the copies:

Replacing squares Stage #2


And again:

Replacing squares #3


And again:

Replacing squares #4


And keep on doing it:

Replacing squares #5


Replacing squares #6


Replacing squares #7


Replacing squares #8


Replacing squares #9


Replacing squares #10


Replacing squares #11


Replacing squares #12


Replacing squares #13


Replacing squares #14


Replacing squares #15


And in the end you’ve got a dragon-curve:

Dragon-curve built from squares


Dragon-curve built from squares (animated)


Tright Treeing

Here is a very simple tree with two branches:

Two-branch tree


These are the steps that a simple computer program follows to draw the tree, with a red arrow indicating where the computer’s focus is at each stage:

Two-branch tree stage 1


2-Tree stage 2


2-Tree stage 3


2-Tree stage 4


2-Tree (animated)


If you had to give the computer an explicit instruction at each stage, the instructions might look something like this:

1. Start at node 1, draw a left branch to node 2 and colour the node green.
2. Return to node 1.
3. Draw a right branch to node 3 and colour the node green.
4. Finish.

Now try a slightly less simple tree with branches that fork twice:

Four-branch tree (static)


These are the steps that a simple computer program follows to draw the tree, with a red arrow indicating where the computer’s focus is at each stage:

4-Tree #1


4-Tree #2


4-Tree #3


4-Tree #4


4-Tree #5


4-Tree #6


4-Tree #7


4-Tree #8


4-Tree #9


4-Tree #10


4-Tree #11


4-Tree (animated)


If you had to give the computer an explicit instruction at each stage, the instructions might look something like this:

1. Start at node 1 and draw a left branch to node 2.
2. Draw a left branch to node 3 and colour it green.
3. Return to node 2.
4. Draw a right branch to node 4 and colour it green.
5. Return to node 2.
6. Return to node 1.
7. Draw a right branch to node 5.
8. Draw a left branch to node 6.
9. Draw a left branch to node 7 and colour it green.
10. Return to node 6.
11. Draw a left branch to node 8 and colour it green.
12. Finish.

It’s easy to see that the list of instructions would be much bigger for a tree with branches that fork three times, let alone four times or you. But you don’t need to give a full set of explicit instructions: you can use a program, or a list of instructions using variables. Suppose the tree has branches that fork f times. If f = 4, you will need an array variable level() with four values, level(1), level(2), level(3) and level(4). Now follow these instructions:

1. li = 1, level(1) = 0, level(2) = 0, ... level(f+1) = 0
2. level(li) = level(li) + 1
3. If level(li) = 1, draw a branch to the left and jump to step 7
4. If level(li) = 2, draw a branch to the right and jump to step 7
5. li = li - 1 (note that this line is reached if the tests fail in lines 3 and 4)
6. If li > 0, jump to step 2, otherwise jump to step 11
7. If li = f, draw a green node and jump to step 5
9. li = li + 1
10. Jump to step 2
11. Finish.

By changing the value of f, a computer can use those eleven basic instructions to draw any size of tree (I’ve left out details like changes in the length of branches and so on). When f = 4, the tree will look like this:

16-Tree (static)


16-Tree (animated)


With simple adjustments, the program can be used for other shapes whose underlying structure can be represented symbolically as a tree. The program is in fact a fractalizer, that is, it draws a fractal. So if you use a version of the program to draw fractals based on right-triangles, you can say you are “tright treeing” (tright = triangle-that-is-right).

Here is some tright treeing. Start with a simple isoceles right-triangle. It can be divided into smaller isoceles right-triangles by finding the midpoint of the hypotenuse, then repeating:

Right-triangle rep-2 stage 1


Right-triangle #2


Tright #3


Tright #4


Tright #5


Tright #6


Tright #7


Tright #7 (no internal lines)


You can distort the isoceles right-triangle in interesting ways by finding the midpoint of a side other than the hypotenuse, like this:

Right-triangle (distorted) #1


Distorted tright #2


Distorted tright #3


Distorted tright #4


Distorted tright #5


Distorted tright #6


Distorted tright #7


Distorted tright #8


Distorted tright #9


Distorted tright #10


Distorted tright #11


Distorted tright #12


Distorted tright #13


Distorted tright (animated)


Here’s a different right-triangle. When you divide it regularly, it looks like this:

Right-triangle rep-3 stage 1


Rep-3 Tright #2


3-Tright #3


3-Tright #4


3-Tright #5


3-Tright #6


3-Tright #7


3-Tright #8


3-Tright #9


3-Tright (one colour)


When you distort the divisions, you can create interesting fractals (click on images for larger versions):

Distorted 3-Tright


Distorted 3-Tright


Distorted 3-Tright


Distorted 3-Tright


Distorted 3-Tright


Distorted 3-Tright


Distorted 3-Tright (animated)


And when four of the distorted right-triangles (rep-2 or rep-3) are joined in a diamond, you can create shapes like these:

Creating a diamond #1


Creating a diamond #2


Creating a diamond #3


Creating a diamond #4


Creating a diamond (animated)


Rep-3 right-triangle diamond (divided)


Rep-3 right-triangle diamond (single colour)


Distorted rep-3 right-triangle diamond


Distorted 3-tright diamond


Distorted 3-tright diamond


Distorted 3-tright diamond


Distorted 3-tright diamond


Distorted 3-tright diamond


Distorted 3-tright diamond


Distorted 3-tright diamond


Distorted 3-tright diamond


Distorted 3-tright diamond


Distorted 3-tright diamond


Distorted 3-tright diamond (animated)


Distorted rep-2 right-triangle


Distorted 2-tright diamond


Distorted 2-tright diamond


Distorted 2-tright diamond


Distorted 2-tright diamond


Distorted 2-tright diamond (animated)


Rep-tilian Rites

A pentomino is one of the shapes created by laying five squares edge-to-edge. There are twelve of them (not counting reflections) and this is the P-pentomino:

p_pentomino

But it’s not just a pentomino, it’s also a rep-tile, or a shape that can divided into smaller copies of itself. There are two ways of doing this (I’ve rotated the pentomino 90° to make the images look better):

p_pentomino_a


p_pentomino_b


Once you’ve divided the shape into four copies, you can divide the copies, then the copies of the copies, and the copies of the copies of the copies, and so on for ever:

p_pentomino_a_anim


p_pentomino_a_anim


And if you’ve got a reptile, you can turn it into a fractal. Simply divide the shape, discard one or more copies, and continue:

p_pentomino_a_124_1

Pentomino-based fractal stage 1


p_pentomino_a_124_2

Pentomino-based fractal stage 2


p_pentomino_a_124_3

Pentomino-based fractal stage 3


p_pentomino_a_124_4

Stage 4


p_pentomino_a_124_5

Stage 5


p_pentomino_a_124_6

Stage 6


p_pentomino_a_124_7

Stage 7


p_pentomino_a_124_8

Stage 8


p_pentomino_a_124_9

Stage 9


p_pentomino_a_124_10

Stage 10


Here are some more fractals created using the same divide-and-discard process:

p_pentomino_b_234

p_pentomino_b_234anim

Animated version


p_pentomino_b_134

p_pentomino_b_134anim

Animated version


p_pentomino_b_124

p_pentomino_b_124anim


p_pentomino_b_123

p_pentomino_b_123anim


p_pentomino_a_134anim

p_pentomino_a_134


p_pentomino_a_234anim

p_pentomino_a_234


p_pentomino_a_124

p_pentomino_a_124anim


p_pentomino_a_123

p_pentomino_a_123anim


You can also use variants on a standard rep-tile dissection, like rotating the copies or trying different patterns of dissection at different levels to see what new shapes appear:

p_pentomino_adj_13

p_pentomino_adj_anim13


p_pentomino_adj_6

p_pentomino_adj_anim6


p_pentomino_adj_anim5

p_pentomino_adj_5


p_pentomino_adj_3

p_pentomino_adj_anim3


p_pentomino_adj_2

p_pentomino_adj_anim2


p_pentomino_adj_1

p_pentomino_adj_anim1


p_pentomino_adj_17

p_pentomino_adj_anim17


p_pentomino_adj_15

p_pentomino_adj_anim15


p_pentomino_adj_16

p_pentomino_adj_anim16


p_pentomino_adj_8

p_pentomino_adj_anim8


p_pentomino_adj_10

p_pentomino_adj_anim10


p_pentomino_adj_11

p_pentomino_adj_anim11


p_pentomino_adj_14

p_pentomino_adj_anim14


p_pentomino_adj_anim4


p_pentomino_adj_anim12


p_pentomino_adj_anim9


p_pentomino_adj_anim7

Fragic Carpet

Maths is like a jungle: rich, teeming and full of surprises. A waterfall here, a glade of butterflies there, a bank of orchids yonder. There is always something new to see and a different route to try. But sometimes a different route will take you to the same place. I’ve already found two ways to reach this fractal (see Fingering the Frigit and Performativizing the Polygonic):

carpet2x2

Fractal Carpet


Now I’ve found a third way. You could call it the rep-tile route. Divide a square into four smaller squares:

square2x2

Add an extra square over the centre:

square2x2_1

Then keep dividing the squares in the same way:

carpet2x2_anim_1

Animated carpet (with coloured blocks)


carpet2x2_anim_2

Animated carpet (with empty blocks)


The colours of the fractal appear when the same pixel is covered repeatedly: first it’s red, then green, yellow, blue, purple, and so on. Because the colours and their order are arbitrary, you can use different colour schemes:

carpet2x2_col1

Colour scheme #1


carpet2x2_col2

Colour scheme #2


carpet2x2_col3

Colour scheme #3


Here are more colour-schemes in an animated gif:

carpet2x2_col

Various colour-schemes


Now try dividing the square into nine and sixteen, with an extra square over the centre:

carpet3x3

3×3 square + central square


carpet3x3_anim

3×3 square + central square (animated)


carpet4x4

4×4 square + central square


carpet4x4_anim

4×4 square + central square (animated)


You can also adjust the size of the square added to the 2×2 subdivision:

carpet2x2_1_2

2×2 square + 1/2-sized central square


carpet2x2_3_4

2×2 square + 3/4-sized central square


Elsewhere Other-Posted:

Fingering the Frigit
Performativizing the Polygonic

Get Your Prox Off #2

Serendipity is the art of making happy discoveries by accident. I made a mistake writing a program to create fractals and made the happy discovery of an attractive new fractal. And also of a new version of an attractive fractal I had seen before.

As I described in Get Your Prox Off, you can create a fractal by 1) moving a point towards a randomly chosen vertex of a polygon, but 2) forbidding a move towards the nearest vertex or the second-nearest vertex or third-nearest, and so on. If the polygon is a square, the four possible basic fractals look like this (note that the first fractal is also produced by banning a move towards a vertex that was chosen in the previous move):

v4_ban1

v = 4, ban = prox(1)
(ban move towards nearest vertex)


v4_ban2

v = 4, ban = prox(2)
(ban move towards second-nearest vertex)


v4_ban3

v = 4, ban = prox(3)


v4_ban4

v = 4, ban = prox(4)


This program has to calculate what might be called the order of proximity: that is, it creates an array of distances to each vertex, then sorts the array by increasing distance. I was using a bubble-sort, but made a mistake so that the program ran through the array only once and didn’t complete the sort. If this happens, the fractals look like this (note that vertex 1 is on the right, with vertex 2, 3 and 4 clockwise from it):
v4_ban1_sw1

v = 4, ban = prox(1), sweep = 1


v4_ban2_sw1

v = 4, ban = prox(2), sweep = 1


v4_ban3_sw1

v = 4, ban = prox(3), sweep = 1


v4_ban3_sw1_anim

(Animated version of v4, ban(prox(3)), sw=1)


v4_ban4_sw1

v = 4, ban = prox(4), sweep = 1


Note that in the last case, where ban = prox(4), a bubble-sort needs only one sweep to identify the most distant vertex, so the fractal looks the same as it does with a complete bubble-sort.

These new fractals looked interesting, so I had the idea of adjusting the number of sweeps in the incomplete bubble-sort: one sweep or two or three and so on (with enough sweeps, the bubble-sort becomes complete, but more sweeps are needed to complete a sort as the number of vertices increases). If there are two sweeps, then ban(prox(1)) and ban(prox(2)) look like this:

v4_ban1_sw2

v = 4, ban = prox(1), sweep = 2


v4_ban2_sw1

v = 4, ban = prox(2), sweep = 2


But the fractals produced by sweep = 2 for ban(prox(3)) and ban(prox(4)) are identical to the fractals produced by a complete bubble sort. Now, suppose you add a central point to the polygon and treat that as an additional vertex. If the bubble-sort is incomplete, a ban(prox(1)) fractal with a central point looks like this:

v4c_ban1_sw1

v = 4+c, ban = prox(1), sw = 1


v4c_ban1_sw2

v = 4+c, ban = prox(1), sw = 2


When sweep = 3, an attractive new fractal appears:

v4c_ban1_sw3

v = 4+c, ban = prox(1), sw = 3


v4c_ban1_sw3_anim

v = 4+c, ban = prox(1), sw = 3 (animated)


If you ban two vertices, the nearest and second-nearest, i.e. ban(prox(1), prox(2)), a complete bubble-sort produces a familiar fractal:

v4_ban12

v = 4+c, ban = prox(1), prox(2)


And here is ban(prox(2), prox(4)), with a complete bubble-sort:

v4c_ban24

v = 4, ban = prox(2), prox(4)


If the bubble-sort is incomplete, sweep = 1 and sweep = 2 produce these fractals for ban(prox(1), prox(2)):

v4_ban12_sw1

v = 4, ban = prox(1), prox(2), sw = 1


v4_ban12_sw2

v = 4, ban = prox(1), prox(2), sw = 2*

*The second of those fractals is identical to v = 4, ban(prox(2), prox(3)) with a complete bubble-sort.


Here is ban(prox(1), prox(5)) with a complete bubble-sort:

4c_ban15

v = 4, ban = prox(1), prox(5)


Now try ban(prox(1), prox(5)) with an incomplete bubble-sort:

v4_ban15_sw1

v = 4, ban = prox(1), prox(5), sw = 1


v4_ban15_sw2

v = 4, ban = prox(1), prox(5), sw = 2


When sweep = 3, the fractal I had seen before appears:

v4_ban15_sw3

v = 4, ban = prox(1), prox(5), sw = 3


v4_ban15_sw3_anim

v = 4, ban = prox(1), prox(5), sw = 3 (animated)


Where had I seen it before? While investigating this rep-tile (a shape that can be tiled with smaller versions of itself):

L-reptile

L-triomino rep-tile


L-reptile_anim

L-triomino rep-tile (animated)


The rep-tile is technically called an L-triomino, because it looks like a capital L and is one of the two distinct shapes you can create by joining three squares at the edges. You can create fractals from an L-triomino by dividing it into four copies, discarding one of the copies, then repeating the divide-and-discard at smaller and smaller scales:

L-reptile_1

L-triomino fractal stage #1


L-reptile_2

L-triomino fractal stage #2


L-reptile_3

L-triomino fractal stage #3


L-reptile_4

L-triomino fractal stage #4


L-reptile_5

L-triomino fractal stage #5


L-reptile_fractal_anim

L-triomino fractal (animated)

L-reptile_fractal_static

L-triomino fractal (close-up)

And here’s part of the ban(prox(1), prox(5)) fractal for comparison:

v4_ban15_sw3_mono


v4_ban15_sw3_col

So you can get to the same fractal (or versions of it), by two apparently different routes: random movement of a point inside a square or repeatedly dividing-and-discarding the sub-copies of an L-triomino. That’s serendipity!


Previously pre-posted:

Get Your Prox Off

Hex Appeal

A polyiamond is a shape consisting of equilateral triangles joined edge-to-edge. There is one moniamond, consisting of one equilateral triangle, and one diamond, consisting of two. After that, there are one triamond, three tetriamonds, four pentiamonds and twelve hexiamonds. The most famous hexiamond is known as the sphinx, because it’s reminiscent of the Great Sphinx of Giza:

sphinx_hexiamond

It’s famous because it is the only known pentagonal rep-tile, or shape that can be divided completely into smaller copies of itself. You can divide a sphinx into either four copies of itself or nine copies, like this (please open images in a new window if they fail to animate):

sphinx4

sphinx9

So far, no other pentagonal rep-tile has been discovered. Unless you count this double-triangle as a pentagon:

double_triangle_rep-tile

It has five sides, five vertices and is divisible into sixteen copies of itself. But one of the vertices sits on one of the sides, so it’s not a normal pentagon. Some might argue that this vertex divides the side into two, making the shape a hexagon. I would appeal to these ancient definitions: a point is “that which has no part” and a line is “a length without breadth” (see Neuclid on the Block). The vertex is a partless point on the breadthless line of the side, which isn’t altered by it.

But, unlike the sphinx, the double-triangle has two internal areas, not one. It can be completely drawn with five continuous lines uniting five unique points, but it definitely isn’t a normal pentagon. Even less normal are two more rep-tiles that can be drawn with five continuous lines uniting five unique points: the fish that can be created from three equilateral triangles and the fish that can be created from four isosceles right triangles:

equilateral_triangle_fish_rep-tile

right_triangle_fish_rep-tile

Rep It Up

When I started to look at rep-tiles, or shapes that can be divided completely into smaller copies of themselves, I wanted to find some of my own. It turns out that it’s easy to automate a search for the simpler kinds, like those based on equilateral triangles and right triangles.

right triangle rep-tiles

right_triangle_fish

equilateral_triangle_reptiles

equilateral_triangle_rocket

(Please open the following images in a new window if they fail to animate)

duodeciamond

triangle mosaic


Previously pre-posted (please peruse):

Rep-Tile Reflections

Rep-Tile Reflections

A rep-tile, or repeat-tile, is a two-dimensional shape that can be divided completely into copies of itself. A square, for example, can be divided into smaller squares: four or nine or sixteen, and so on. Rectangles are the same. Triangles can be divided into two copies or three or more, depending on their precise shape. Here are some rep-tiles, including various rep-triangles:

Various rep-tiles

Various rep-tiles — click for larger image

Some are simple, some are complex. Some have special names: the sphinx and the fish are easy to spot. I like both of those, particularly the fish. It would make a good symbol for a religion: richly evocative of life, eternally sub-divisible of self: 1, 9, 81, 729, 6561, 59049, 531441… I also like the double-square, the double-triangle and the T-tile in the top row. But perhaps the most potent, to my mind, is the half-square in the bottom left-hand corner. A single stroke sub-divides it, yet its hypotenuse, or longer side, represents the mysterious and mind-expanding √2, a number that exists nowhere in the physical universe. But the half-square itself is mind-expanding. All rep-tiles are. If intelligent life exists elsewhere in the universe, perhaps other minds are contemplating the fish or the sphinx or the half-square and musing thus: “If intelligent life exists elsewhere in the universe, perhaps…”

Mathematics unites human minds across barriers of language, culture and politics. But perhaps it unites minds across barriers of biology too. Imagine a form of life based on silicon or gas, on unguessable combinations of matter and energy in unreachable, unobservable parts of the universe. If it’s intelligent life and has discovered mathematics, it may also have discovered rep-tiles. And it may be contemplating the possibility of other minds doing the same. And why confine these speculations to this universe and this reality? In parallel universes, in alternative realities, minds may be contemplating rep-tiles and speculating in the same way. If our universe ends in a Big Crunch and then explodes again in a Big Bang, intelligent life may rise again and discover rep-tiles again and speculate again on their implications. The wildest speculation of all would be to hypothesize a psycho-math-space, a mental realm beyond time and matter where, in mathemystic communion, suitably attuned and aware minds can sense each other’s presence and even communicate.

The rep-tile known as the fish

Credo in Piscem…

So meditate on the fish or the sphinx or the half-square. Do you feel the tendrils of an alien mind brush your own? Are you in communion with a stone-being from the far past, a fire-being from the far future, a hive-being from a parallel universe? Well, probably not. And even if you do feel those mental tendrils, how would you know they’re really there? No, I doubt that the psycho-math-space exists. But it might and science might prove its existence one day. Another possibility is that there is no other intelligent life, never has been, and never will be. We may be the only ones who will ever muse on rep-tiles and other aspects of mathematics. Somehow, though, rep-tiles themselves seem to say that this isn’t so. Particularly the fish. It mimics life and can spawn itself eternally. As I said, it would make a good symbol for a religion: a mathemysticism of trans-biological communion. Credo in Piscem, Unum et Infinitum et Æternum. “I believe in the Fish, One, Unending, Everlasting.” That might be the motto of the religion. If you want to join it, simply wish upon the fish and muse on other minds, around other stars, who may be doing the same.