Jumper to Jumper

Previously I’ve looked at fractals created by a point moving half-way towards the random chosen vertex of a polygon. But you can also choose an initial vertex, then choose a new vertex by adding a random number to that initial vertex. Then repeat. For example, if the polygon is a square and the initial vertex is v = 1, then choose v + 3 = 4 or v – 1 = 3, and so on.

You can then ban or un-ban the choice of vertex-jump as you can ban or un-ban direct choices of vertex. These two methods of random choice are effectively the same, but one can be simpler to program than the other. That’s why I’ve come across some new fractals by using vertex-jumps. Here they are:

vertices = 4, vertex-jump = (1,2,3,4), ban on same choice twice in a row


vertices = 4, vertex-jump = (1,2,3,4), ban on 2 in row (black-and-white version)


v = 4, vj = (1,2,3,4), ban on choice c + 2 from previous choice c


v = 4, vj = (1,2,3,4), ban c + 2 (animated gif)


vj = (1,2,3,4), ban c + 2 (black-and-white)


vj = (1,2,3,4), ban c + 0 at time t+1 unless c + 0 at time t-1


vj = (1,2,3,4), ban c + 0 at t+1, unless c + 0 at t-1 (black-and-white)


vj = (1,2,3,4,5), ban c + 0


vj = (0,1,2,3,4), ban c + 0


vj = (0,1,2,3,4), ban c + 0 (black-and-white)


vj = (1,2,3,4), ban c + 2 at t+1 unless c + 2 at t-1 (animated gif)


vj = (1,2,3,4), ban c + various at t+1 unless c + various at t-1 (animated gif)


vj = (1,2,3,4,5), ban c + 0 at t+1 unless c + 0 at t-1


vj = (-2,-1,0,1,2), ban c + 0


vj = (-2,-1,0,1,2), ban c + 0 (black-and-white)


vj = (0,1,2,3,4), ban c + va unless c + va


v = 5, vj = (1,2,3,4), ban c + 0


v = 5, vj = (1,2,3,4), ban c + 2


v = 5, vj = (0,1,2,3), ban c + 3


v = 6, vj = (0,1,2,3), ban c + 2


v = 5, vj = va, ban c + va (animated gif)


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

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):

Sierpinski triangle

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:

triangle

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.

square

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

pentagon

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:

square_used1

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:

square_used1_center

square_used1_vi1

square_used1_vi2

square_used2

pentagon_lm0.6

pentagon_used1_5_vi1

hexagon_used1_6_vi3