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

Boldly Breaking the Boundaries

In “M.I.P. Trip”, I looked at fractals like this, in which a square is divided repeatedly into a pattern of smaller squares:
2x2inner

2x2inner_static


3x3innera

3x3innera_static


3x3innerb

3x3innerb_static


As you can see, the sub-squares appear within the bounds of the original square. But what if some of the sub-squares appear beyond the bounds of the original square? Then a new family of fractals is born, the over-fractals:

fractal2x2a

fractal2x2a_static


fractal2x2b

fractal2x2b_static


fractal2x2c

fractal2x2c_static


fractal2x2d

fractal2x2d_static


fractal2x2e

fractal2x2e_static


fractal3x3a

fractal3x3a_static


fractal3x3b

fractal3x3b_static


fractal3x3c

fractal3x3c_static


fractal3x3d


fractal3x3e


fractal3x3f


fractal3x3g


fractal3x3h


fractal3x3i


fractal3x3j


fractal3x3k


fractal3x3l


fractal3x3m


fractal3x3n


fractal4x4a


fractal4x4c


fractal4x4b

M.i.P. Trip

The Latin phrase multum in parvo means “much in little”. It’s a good way of describing the construction of fractals, where the application of very simple rules can produce great complexity and beauty. For example, what could be simpler than dividing a square into smaller squares and discarding some of the smaller squares?

Yet repeated applications of divide-and-discard can produce complexity out of even a 2×2 square. Divide a square into four squares, discard one of the squares, then repeat with the smaller squares, like this:

2x2square2


2x2square3


Increase the sides of the square by a little and you increase the number of fractals by a lot. A 3×3 square yields these fractals:

3x3square2


3x3square3


3x3square6


3x3square7


3x3square8


3x3square9


3x3square10


And the 4×4 and 5×5 fractals yield more:
4x4square1


4x4square2



4x4square4


4x4square5


4x4square6


4x4square7


4x4square8


5x5square1


5x5square2


5x5square3


5x5square4


5x5square5


5x5square6


5x5square7