# Square Routes Revisited

Take a square, divide it into four smaller squares, and discard the smaller square on the top right. Do the same to each of the subsquares, dividing it into four sub-subsquares, then discarding the one on the top right. And repeat with the sub-subsquares. And the sub-sub-squares. And the sub-sub-sub-squares. And so on. The result is a fractal like this:

Stage 1

Stage 2

Stage 3

Stage 4

Animated fractal

Final fractal (static)

It looks as though this procedure isn’t very fertile. But you can enrich it by rotating each of the subsquares in a different way, so that the discarded sub-subsquare is different. Here’s an example:

Stage 1

Stage 2

Stage 3

Stage 4

Stage 5

Stage 6

Stage 7

Animated fractal

Final fractal (static)

Here are more examples of how rotating the subsquares in different ways produces different fractals:

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Animated fractal

Static fractal

Previously pre-posted:

Square Routes — first look at this kind of fractal

# Appointment with Distality

distal, adj. Anat. Situated away from the centre of the body, or from the point of origin (said of the extremity or distant part of a limb or organ); terminal. Opp. to proximal. [← stem of dist- (in distant adj.) + -al, after dorsal, ventral, etc.] — Oxford English Dictionary

When a point jumps inside a triangle, moving halfway towards a randomly chosen vertex each time, a fractal known as the Sierpiński triangle appears:

Point jumping halfway towards random vertex of a triangle

Point jumping inside triangle (black-and-white version)

But when a point moves at random in the same way inside a square, no fractal appears. Instead, the interior of the square gradually fills with a haze of pixels:

Point jumping halfway towards random vertex of a square

Now trying imposing restrictions on the point jumping inside a square. If it can’t jump towards a vertex twice in a row, this fractal appears:

Ban consecutive jumps towards same vertex

Ban consecutive jumps towards same vertex (black-and-white version)

Suppose the vertices are numbered from 1 to 4 and the point can’t jump towards the vertex one lower than the previously chosen vertex. That is, if it jumps towards vertex 3, it can’t jump next towards vertex 2, but it can jump towards vertices 1, 3, or 4 (if the vertex is 1, it’s banned from moving towards vertex 4, i.e. 1-1 = 0 = 4). Now this fractal appears:

This is the fractal when the point can’t jump towards the vertex two places lower than the one it has just jumped towards:

But if you can ban, you can also un-ban. Suppose the point jumps towards vertex v at time t and is then banned from jumping towards vertex v-2 at time t+1 unless it had jumped towards vertex v-1 at time t-1. This interesting fractal appears:

Ban jump v-2 at t+1 unless jump v-1 at t-1

Here are some more fractals using the ban / un-ban technique:

Ban / un-ban various

Ban jump v+0 at t+1 unless jump v+1 at t-1

Ban jump v+1 at t+1 unless jump v+3 at t-1

Ban jump v+0 at t+1 unless jump v+2 at t-1

Ban jump v+2 at t+1 unless jump v+2 at t-1

Ban / un-ban various

You can also impose or lift bans based not on the vertex the point jumps towards, but on the distance the point jumps. For example, take the radius r of the circle circumscribing the square and divide it into four segments, 0 to ¼r, ¼r to ½r, ½r to ¾r, and ¾r to r. When the point is going to jump towards vertex v, test whether its jump will land in the same segment, measured from the center of the circle, as it currently occupies. If it does, ban the jump and choose another vertex. Or unban the vertex if the point occupied segment s + x at time t-1. Here are some of the fractals produced using this technique:

Ban / un-ban based on distance jumped

Ban jump into segment s+0 of 4

Ban jump into segment s+1 from center

Ban jump into segment s+2

Ban jump into s+2 at t+1 unless jump into s+2 at at t-1

Ban jump into s+0 from present point

Ban jump into s+2 from present point

Ban jump into s+3 from present point

Ban jump into s+0 at t+1 unless jump into s+1 at at t-1

It’s easy to think of variants on all these themes, but I’ll leave them as an exercise for the interested reader.

# Square Routes

One of the pleasures of exploring an ancient city like York or Chester is that of learning new routes to the same destination. There are byways and alleys, short-cuts and diversions. You set off intending to go to one place and end up in another.

Maths is like that, even at its simplest. There are many routes to the same destination. I first found the fractal below by playing with the L-triomino, or the shape created by putting three squares in the shape of an L. You can divide it into four copies of the same shape and discard one copy, then do the same to each of the sub-copies, then repeat. I’ve decided to call it the hourglass fractal:

Hourglass fractal (animated)

Hourglass fractal (static)

Then I unexpectedly came across the fractal again when playing with what I call a proximity fractal:

Hourglass animated (proximity fractal)

(Static image)

Now I’ve unexpectedly come across it for a third time, playing with a very simple fractal based on a 2×2 square. At first glance, the 2×2 square yields only one interesting fractal. If you divide the square into four smaller squares and discard one square, then do the same to each of the three sub-copies, then repeat, you get a form of the Sierpiński triangle, like this:

Sierpiński triangle stage 1

Sierpiński triangle #2

Sierpiński triangle #3

Sierpiński triangle #4

Sierpiński triangle animated

(Static image)

The 2×2 square seems too simple for anything more, but there’s a simple way to enrich it: label the corners of the sub-squares so that you can, as it were, individually rotate them 0°, 90°, 180°, or 270°. One set of rotations produces the hourglass fractal, like this:

Hourglass stage 1

Hourglass #2

Fractal #3

Hourglass #4

Hourglass #5

Hourglass #6

Hourglass animated

(Static image)

Here are some more fractals from the 2×2 square created using this technique (I’ve found some of them previously by other routes):

(Static image)

(Static image)

(Static image)

(Static image)

(Static image)

(Static image)

(Static image)

(Static image)

(Static image)

(Static image)

# Polymorphous Perverticity

As I’ve explained before on Overlord of the Über-Feral, the planet’s premier purveyor of polygonic performativity (probably (possibly (perspectivistically))), it works with triangles and pentagons, but not with squares. And what is “it”? A simple procedure in which you create a polygon, choose a point inside it, then repeatedly move half-way towards a vertex chosen at random, marking each new position as you go.

When the polygon has three vertices, you get a Sierpiński triangle. When it has five, you get what might be called a  Sierpiński pentagon. When it has four, you get nothing. Or rather: you get everything, because the whole interior of the square gradually fills with points. But, as I’ve also explained before, there’s a simple way to change this. You can adapt the procedure so that a vertex can’t be chosen twice in a row, and so on.

When the rule is “No vertex twice in a row”, you get this fractal (colours change as a pixel is selected again):

But you can also use what might be a vertex increment, or vi, whereby you disallow vertices that are next to the previously chosen vertex, or two positions away, and so on. When the rule is “No vertex twice in a row”, the disallowed vertex is (v + 0), that is, vi = 0. If vi = 2 and the rule is disallow(v + 2), this fractal appears (when vi = 1, there’s no fractal):

v = 4, vi = 2

You can extend these rules to apply not just to the previously chosen vertex, but also to the vertex chosen before that. Here are some fractals produced by the rule disallow(v[1] + vi[1], v[2] + vi[2]), where v[1] is the vertex previously chosen and v[2] is the vertex chosen before that:

v = 4, vi[1] = 1, vi[2] = 2

v = 4, vi[1] = 2, vi[2] = 0

v = 4, vi[1] = 2, vi[2] = 1

v = 4, vi[1] = 2, vi[2] = 2

And here are some fractals produced by the rule disallow(v[1] + vi[1], v[2] + vi[2], v[3] + vi[3]):

v = 4, vi[1] = 1, vi[2] = 1, vi[3] = 0

v = 4, vi[1] = 1, vi[2] = 1, vi[3] = 2

Applying these rules to pentagons rather than squares doesn’t produce such a dramatic difference, because the original procedure – choose any vertex at random, taking no account of previous choices – produces a fractal when v = 5, as noted above, but not when v = 4. Nevertheless, here are some fractals for v > 4:

v = 5, vi = 0

v = 5, vi = 1

v = 5, vi = 2

v = 5, vi[1] = 0, vi[2] = 0

v = 5, vi[1] = 1, vi[2] = 0

v = 5, vi[1] = 2, vi[2] = 0

v = 5, vi[1] = 1, vi[2] = 1

v = 5, vi[1] = 1, vi[2] = 1, vi[3] = 1

v = 5, vi = various

v = 6, vi = 1

# Tri Again

All roads lead to Rome, so the old saying goes. But you may get your feet wet, so try the Sierpiński triangle instead. This fractal is named after the Polish mathematician Wacław Sierpiński (1882-1969) and quite a few roads lead there too. You can create it by deleting, jumping or bending, inter alia. Here is method #1:

Divide an equilateral triangle into four, remove the central triangle, do the same to the new triangles.

Here is method #2:

Pick a corner at random, jump half-way towards it, mark the spot, repeat.

And here is method #3:

Bend a straight line into a hump consisting of three straight lines, then repeat with each new line.

Each method can be varied to create new fractals. Method #3, which is also known as the arrowhead fractal, depends on the orientation of the additional humps, as you can see from the animated gif above. There are eight, or 2 x 2 x 2, ways of varying these three orientations, so eight fractals can be produced if the same combination of orientations is kept at each stage, like this (some are mirror images — if an animated gif doesn’t work, please open it in a new window):

If different combinations are allowed at different stages, the number of different fractals gets much bigger:

• Continuing viewing Tri Again.

# V for Vertex

To create a simple fractal, take an equilateral triangle and divide it into four more equilateral triangles. Remove the middle triangle. Repeat the process with each new triangle and go on repeating it. You’ll end up with a shape like this, which is known as the Sierpiński triangle, after the Polish mathematician Wacław Sierpiński (1882-1969):

But you can also create the Sierpiński triangle one pixel at a time. Choose any point inside an equilateral triangle. Pick a corner of the triangle at random and move half-way towards it. Mark this spot. Then pick a corner at random again and move half-way towards the corner. And repeat. The result looks like this:

A simple program to create the fractal looks like this:

initial()
repeat
fractal()
altervariables()
until false

function initial()
v = 3 [v for vertex]
r = 500
lm = 0.5
endfunc

function fractal()
th = 2 * pi / v
[the following loop creates the corners of the triangle]
for l = 1 to v
x[l]=xcenter + sin(l*th) * r
y[l]=ycenter + cos(l*th) * r
next l
fx = xcenter
fy = ycenter
repeat
rv = random(v)
fx = fx + (x[rv]-fx) * lm
fy = fy + (y[rv]-fy) * lm
plot(fx,fy)
until keypressed
endfunc

function altervariables()
[change v, lm, r etc]
endfunc

In this case, more is less. When v = 4 and the shape is a square, there is no fractal and plot(fx,fy) covers the entire square.

When v = 5 and the shape is a pentagon, this fractal appears:

But v = 4 produces a fractal if a simple change is made in the program. This time, a corner cannot be chosen twice in a row:

function initial()
v = 4
r = 500
lm = 0.5
ci = 1 [i.e, number of iterations since corner previously chosen]
endfunc

function fractal()
th = 2 * pi / v
for l = 1 to v
x[l]=xcenter + sin(l*th) * r
y[l]=ycenter + cos(l*th) * r
chosen[l]=0
next l
fx = xcenter
fy = ycenter
repeat
repeat
rv = random(v)
until chosen[rv]=0
for l = 1 to v
if chosen[l]>0 then chosen[l] = chosen[l]-1
next l
chosen[rv] = ci
fx = fx + (x[rv]-fx) * lm
fy = fy + (y[rv]-fy) * lm
plot(fx,fy)
until keypressed
endfunc

One can also disallow a corner if the corner next to it has been chosen previously, adjust the size of the movement towards the chosen corner, add a central point to the polygon, and so on. Here are more fractals created with such variations: