Formulas Focal to the Flesh

Here’s an interesting formula:

fr(1) = 1/2; mx = 3
fr(i) = fr(i-1) + 1/fr(i-1)
if fr(i) > mx, fr(i) = fr(i) – mx

Early terms look like this:

0.5, 2.5, 2.9, 3.244827586…, 4.329334628…, 2.081590666…, 2.561992513…, 2.952313716…, 3.291031107…, 3.727089920…, 2.102435627…, 2.578074447…, 2.965960841…, 3.303119709…, 3.602146368…, 2.262872154…, 2.704788415…, 3.074503101…, 13.49676325…, 10.59203071…, 7.723747777…, 4.935444092…, 2.452121378…, 2.859931533…, 3.209590254…, 4.980804482…, 2.485649867…, 2.887959143…, 3.234224430…, 4.503633905…, 2.168689406…

Can you see any patterns emerging? I’d guess not. And I’d guess a thousand more terms wouldn’t help you see any better. It’s hard for humans to see patterns in a jumble of numbers. Our eyes don’t work as well on numbers as on shapes. That’s why you can make that formula focal to the flesh, as it were, by plotting the numbers on a graph. Or part of the numbers, anyway. Suppose you take the fractional parts of each pair of terms and use them to map (x,y) on a FractL (my name for a graph whose arms run from 0 to 1). For example, the terms 4.935444092… and 2.452121378… would yield x = 0.935444092… and y = 0.452121378… (or vice versa). The resultant graph makes the formula focal to the flesh. And it’s replete with patterns:

fr(i)+=1/fr(i-1); if fr(i)>3, fr(i)-=3; x = frac(fr(i)), y = frac(fr(i+1))


I can’t explain the patterns and they may arise from limited precision in the decimal digits. But I like them however they arise. The graph doesn’t change when mx = 4 (although it creates the lines in a different order):

if fr(i)>4, fr(i)-=4


But it does change when mx = 4/3. The lines almost vanish, except for a tiny comet-like mark towards the upper right-hand corner:

if fr(i)>4/3, fr(i)-=4/3


When mx = 7/2, the graph of mx = 3|4 is back in a slightly different form:

if fr(i)>7/2, fr(i)-=7/2


And again with 7/3:

if fr(i)>7/3, fr(i)-=7/3


There’s a big change with 7/4, Most of the lines disappear:

if fr(i)>7/4, fr(i)-=7/4


And only the main lines appear with 9/5:

if fr(i)>9/5, fr(i)-=9/5


And so on till you try fr -= 2/f, as noted below:

if fr(i)>11/5, fr(i)-=11/5


if fr(i)>11/6, fr(i)-=11/6


if fr(i)>15/8, fr(i)-=15/8


if fr(i)>29/15, fr(i)-=29/15


Now try fr += 2/fr and fr += 3/fr. This is what happens:

fr += 2/fr; if fr(i)>3, fr(i)-=3


fr += 2/fr; if fr(i)>8/3, fr(i)-=8/3


fr += 2/fr; if fr(i)>11/4, fr(i)-=11/4


fr += 3/fr; if fr(i)>6, fr(i)-=6


And what about these graphs?




They’re created by seeding a sum, s, with a fraction, then adding more fractions < 1 whose numerators = 1,2,3… and whose denominators are the prime numbers 1, s -= 1. When s > 1, s -= 1. Then you take the fractional parts of s(i) and s(i+1) and graph (x,y) as above.


Post-Performative Post-Scriptum

The title of this post refers to Morbid Angel’s Formulas Fatal to the Flesh (1998). I’ve never heard it, but I like Morbid Angel’s alphabetically alliterative album-titles.

The Bird Dimension

M.C. Escher, Another World / Andere Wereld (1947)


This is almost my favorite image by Escher. But I’d like a frEscher perspective in it: I think the bird should be looking in the other direction, out into the impossibly overlapping universes, not into the cupola and at the viewer.

Third Whirled Warp

Here’s a regular hexagon inside a regular triangle, that is, an equilateral triangle:

Regular hexagon inside regular triangle


Imagine that two points are moving around the perimeter of each polygon, with the hex-point moving half as fast as the tri-point (after adjustment for the incommensurate relative lengths of the perimeters). If you trace the midpoint of the twin spinning points, you get this shape:

v3v6, 1 : 1/2, pol


And if you adjust the midpoint path as though the triangle had been stretched into a circle, you get this shape:

v3v6, 1 : 1/2, circ, pol


Here’s the same when the ratio of speeds is 1/2 to 1/3, that is, 1 to 2/3:

v3v6, 1/2 : 1/3, circ, pol


Without the polygons, it looks like this:

v3v6, 1/2 : 1/3, circ


When the ratio of speeds if -1/3 to 2/3, that is, the tri-point is moving counter-clockwise around the triangle, you get this shape:

v3v6, -1/3 : 2/3, pol


When it’s stretched into a circle, you get this:

v3v6, -1/3 : 2/3, circ, pol


It looks like a moustache:

v3v6, -1/3 : 2/3, circ


Here are more midpoint shapes created with a hexagon inside a triangle:

v3v6, 2/2 : 3/3, circ


v3v6, -1/2 : 3/4, circ


v3v6, 1/4 : 1/5, circ


v3v6, -1/4 : 3/4, circ


v3v6, -1/4 : 4/5, circ


v3v6, 2/3 : 3/4, circ


v3v6, 2/3 : 3/5, circ


v3v6, 3/4 : 4/5, circ


v3v6, 3/4 : 4/5, circ


Now try aligning the nested hexagon like this, so that the sides of the hexagon coincide with the middle third of the sides of the triangle:

v3v6, side alignment


With two points moving in a ratio of 1/3 to 1/4, you get this midpoint shape:

v3v6, sided, 1/3 : 1/4, pol


Here it is without the polygons:

v3v6, sided, 1/3 : 1/4


Now try a regular octagon inside a square:

v4v8, 1/2 : 1/3, circ, pol


v4v8, 1/2 : 1/3, circ


v4v8, -1/3 : 3/4, circ


v4v8, 2/3 : 3/5, circ


Now place a triangle inside a hexagon:

v6v3, 1 : 1/4, pol


If you stretch the midpoint path according to perimeter of the triangle, you get this:

v6v3, 1 : 1/4, circ, pol


v6v3, 1 : 1/4, circ


The three stretching shapes remind me of hands in Egyptian art, like this image of King Tutankhamun and Queen Ankhesenamun:

Detail from the Golden Throne of Tutankhamnun


Here are more midpoint paths:

v6v3, 1 : -1/4, circ


v6v3, 1 : 1/2, circ


v6v3, 1 : 1/3, circ


v6v3, -1 : 1/3, circ


v6v3, -1 : 1/4, circ


v6v3, 1 : 1/5, circ


v6v3, 2/3 : 1/4, circ


Now try a square inside an octagon:

v8v4, 2/3 : 1/4, circ, pol


v8v4, 2/3 : 1/4, circ


v8v4, 2/5 : 1/6, circ


v8v4, 2/5 : 3/7, circ


v8v4, 4/5 : 3/7, circ


Elsewhere Other-Accessible…

First Whirled Warp — an earlier look at this kind of geometry
Second Whirled Warp — and another earlier look

The Hex Crystals

To coin a phrase: Never Mind the Bollocks — Here’s the Hex Crystals! And what is a hex crystal? It’s what I call a shape that’s created algorithmo inside a hexagon and looks like a crystal:

A hex crystal


Here are some more hex-crystals:




I came across hex-crystals when I was looking at an interesting little geometrical question. How does sum(vd), the sum of distances to the vertices of a square, vary from different points, (x,y), inside the square? Say the square is created inside a circle of radius = 500 units and centered on (x,y) = (0,0). When the point is at (0,0), the center of the square, sum(vd) is obviously 2000, because the four vertices all fall on the perimeter of the circle at 500 units from the center and 4 * 500 = 2000:
0

sum(vd) = 2000 = sum of distances to vertices from (0,0)


When is sum(vd) at a maximum? When the point is on one or another of the vertices, which are at (+/-354,+/-354) units in relation to the center at (0,0):

sum(vd) = 2414 = sum of distances to vertices from (354,-354)


More precisely, the sum is 2414.213562373… = 1000 * (√2 + 1) units and the vertices are at (+/-353.55339…, +/-353.55339…) units, as simple geometry dictates for a square inside a circle of radius 500. Accordingly, sum(vd) varies between exactly 2000 and 2414.213562373… as the point moves inside the square:

sum(vd) = 2165 from (132,256)


sum(vd) = 2182 from (-135,271)


sum(vd) = 2069 from (177,51)


I wondered what shapes appeared as one traced the route of a point jumping, say, 1/2 towards the vertices according to tests on sum(vd). For example, if the point starts at (0,0) at time t0) and sum(vd) at time ti has to be alternately greater and less than sum(vd) at ti-1 for successive jumps, you get this shape:

jump = 1/2, test = sum(vd,ti) >,< sum(vd,ti-1)


You can use the binary number 10bin to represent the test on sum(vd) at ti-1 and ti-1, i.e. the test at jump 1 is sum(vd,ti) > sum(vd,ti-1), at step 2 is sum(vd,ti) < sum(vd,ti-1), and so on. Using the same test and a jump of 1/3, you get this shape:

jump = 1/3, test = sum(vd,ti,10bin)


Now the shape is clearly a fractal. So are some of the other shapes I found by applying the same kind of tests to a point jumping inside a pentagon:

vertex = 5, jump = 55/144 = fib(10) / fib(12), test on sum(vd) = 10bin


v = 5, j = 55/144, test = 10010bin


v = 5, j = 55/144, test = 11000bin


When test = 10010bin, you read the binary number left-to-right and check for s1><s0,s2<s1,s3<s2,s4>s3,s5<s4. Then you apply the same tests to subsequent jumps, i.e., you return to the beginning of the binary number and read it left-to-right again. Now let’s apply similar tests to hexagons and create some hex-crystals:

v = 6, j = 1/2, test = 10bin


Various hex-crystals (animated gif courtesy EZgif)


I searched an array to calculate the possible routes, so the same test yielded different results depending on dp, the depth of the search. This is because tl, the length of the test, fits more or less well into dp by dp modulo tl, that is, by whether tl is a factor of dp. For example, when the test is 110 and tl = 3, you get this with dp = 9:

v = 6, j = 1/2, test = 110, dp = 9


And you get this when dp = 10 (i.e., dp = 9+1):

v = 6, j = 1/2, test = 110bin, dp = 10dec


Here are some more hex-crystals:

test = 1100bin


test = 1110bin


test = 10010bin


test = 11010bin


test = 11100bin


test = 101000, dp = 12


test = 101100bin


test = 111100bin


test = 111100, dp = 11


test = 1110010bin


test = 1111100bin


test = 10010110bin


test = 10011110bin


test = 11000110bin


test = 11001110bin


test = 11010110bin


test = 11100110bin


test = 11101000bin


test = 11110010bin


test = 100101000bin


test = 100111110bin


test = 110011110bin


test = 110111000bin


test = 1001101010bin


test = 1001111000bin


test = 1001111010bin


test = 1010011110bin


test = 1011101110bin


test = 1101010000bin


test = 1110001110bin


test = 1110101000bin


test = 1110101010bin


test = 1111100010bin


j = 1/3, test = 1 (i.e., for all jumps sum(vd) at ti > sum(vd) at ti-1, center point


j = 2/3, test = 11100bin


j = 2/5, test = 10010bin


Finally, here are some hex-crystals based on a test of sorted distances from (x,y), i.e. how the vertices rank by distance from (x,y):




Fractional Fractal

Serendipity in some simplification statistics. That’s what I encountered the other day. I was looking at the ways to simplify this set of fractions:

1/2, 1/3, 2/3, 1/4, 2/4, 3/4, 1/5, 2/5, 3/5, 4/5, 1/6, 2/6, 3/6, 4/6, 5/6, 1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 1/8, 2/8, 3/8, 4/8, 5/8, 6/8, 7/8, 1/9, 2/9, 3/9, 4/9, 5/9, 6/9, 7/9, 8/9, 1/10, 2/10, 3/10, 4/10, 5/10, 6/10, 7/10, 8/10, 9/10, 1/11, 2/11, 3/11, …

The underlined fractions are not in their simplest possible form. For example, 2/4 simplifies to 1/2, 2/6 to 1/3, 3/6 to 1/2, and so on:

1/2, 1/3, 2/3, 1/4, 2/4 → 1/2, 3/4, 1/5, 2/5, 3/5, 4/5, 1/6, 2/6 → 1/3, 3/6 → 1/2, 4/6 → 2/3, 5/6, 1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 1/8, 2/8 → 1/4, 3/8, 4/8 → 1/2, 5/8, 6/8 → 3/4, 7/8, 1/9, 2/9, 3/9 → 1/3, 4/9, 5/9, 6/9 → 2/3, 7/9, 8/9, 1/10, 2/10 → 1/5, 3/10, 4/10 → 2/5, 5/10 → 1/2, 6/10 → 3/5, 7/10, 8/10 → 4/5, 9/10, 1/11, 2/11, 3/11, …

I counted the number of times the simplest possible fractions occurred when simplifying all fractions a/b for (b = 2..n, a = 1..b-1), then displayed the stats as a graph running from 0/1 to 1/1. And there was serendipity in these simplification statistics, because a fractal had appeared:

Graph for count of simplest possible fractions from a/b for (b = 2..n, a = 1..b-1)


It’s interesting to work out what fractions appear where. For example, the peak in the middle is 1/2, but what are the next-highest peaks on either side? The answers are more obvious in the colored version of the graph:

Colored graph for count of simplest possible fractions
Key: n/2, n/3, n/4, n/5, n/6, n/7


The line for 1/2 is red, the lines for 1/3 and 2/3 in light green, the lines for 1/4 and 3/4 in yellow, and so on. But those graphs appear in an equilateral triangle, as it were. The fractals get easier to see in the full-sized versions of these widened graphs:

Widened graph for count of simplest possible fractions from a/b for (b = 2..n, a = 1..b-1)

(click for full size)


Widened and colored graph for count of simplest possible fractions

(click for full size)


Mathemorchids

Flowers are modified leaves. That’s a scientific fact. And it must depend on the way the genetic program of a plant allows for change in variables of growth — in the relative dimensions, directions and forms of various collections of cells.

But I wasn’t thinking of flowers or leaves or botany when I wrote a program to trace the path taken by a point moving in various ways between the center and perimeter of a circle. After I’d run the program, I was definitely thinking of flowers and leaves. How could I not be, when they appeared on the screen in front of my eyes? By adjusting variables in the program, I could produce either flowers or leaves or something between the two:

Flower without color


Flower with color






Some of the flower-shapes reminded me of orchids, so I called them mathemorchids. The variables I used governed this procedure:

defprocmathemorchid
rd = 0
jump = jmin
jinc = +1
repeat
xr = xc + int(sin(rd) * rdius + sin(rd * xmult) * xminl)
yr = yc + int(cos(rd) * rdius + cos(rd * ymult) * yminl)
jump = jump + jinc
if(jump = jmin) or (jump >= jmax) then jinc = -jinc
procDrawLine(xr,yr,xc,yc,jump)
rd = rd + rdinc
until rd > maxrd
endproc

Here are explanations of the variables:

rd — short for radian and setting the angle of the point, 0 to maxrd = pi * 2, as it moves between the center and perimeter of the circle
rdinc — the amount by which rd is incremented
xc, yc — the center of the circle
rdius — the radius of the circle
xr, yr — the adjustable radiuses used in trigonometric calculations for the x and y dimensions
xmult, ymult — used to multiply rd for further trig-calcs using…
xminl, yminl — the lengths by which xr and yr are adjusted
jmin, jmax — these are the lower and upper bounds for a rising and falling variable called jump, which determines how far the point moves before it’s marked on the screen

If you look at the use of the sine and cosine functions, you’ll see that the point can swing back on its path or swing ahead of itself, as it were. That’s how the path of the point can simulate three-dimensionality as it lays down thicker or thinner patches of pixels.

Here are the mathemorchids, leaves, scallops and other shapes created by adjusting the variables described above (with more of the generating program as an appendix):

Mathemorchid for jmin = 6, jmax = 69, xmult = 7, ymult = 7, xminl = 40, yminl = 88 (see file-name)





























 

















And here are a few more examples of the mathemorchids and other shapes look like without color:





 



Code for creating the Mathemorchids

defprocmathemorchid
rd = 0
rd = 0
jump = jmin
jinc = +1
repeat
xr = xc + int(sin(rd) * rdius + sin(rd * xmult) * xminl)
yr = yc + int(cos(rd) * rdius + cos(rd * ymult) * yminl)
jump = jump + jinc
if(jump = jmin) or (jump >= jmax) then jinc = -jinc
procDrawLine(xr,yr,xc,yc,jump)
rd = rd + rdinc
k=inkey(0)
until rd > maxrd or k > -1
endproc

defprocDrawLine(x1,y1,x2,y2,puttest)
xdiff = x1 – x2
ydiff = y1 – y2
if abs(xdiff) > abs(ydiff) then
yinc = -ydiff / abs(xdiff)
if xdiff < 0 then xinc = +1 else xinc = -1
else
xinc = -xdiff / abs(ydiff)
if ydiff colrmx then col = 1
put = 0
endif
if int(x) x2 then x = x + xinc
if int(y) y2 then y = y + yinc
iffunc=2then
ifx<x_lo x_lo=x
ifyx_hi x_hi=x
ify>y_hi y_hi=y
endif
until fnreached
endproc

deffnreached
if xinc > 0 then
xreached = int(x) >= x2
else
xreached = int(x) 0 then
yreached = int(y) >= y2
else
yreached = int(y) <= y2
endif
= xreached and yreached
end

The Wyrm Ferns

A fern is a fractal, a shape that contains copies of itself at smaller and smaller scales. That is, part of a fern looks like the fern as a whole:

Fern as fractal (source)


Millions of years after Mother Nature, man got in on the fract, as it were:

The Sierpiński triangle, a 2d fractal


The Sierpiński triangle is a fractal created in two dimensions by a point jumping halfway towards one or another of the three vertices of a triangle. And here is a fractal created in one dimension by a point jumping halfway towards one or another of the two ends of a line:

A 1d fractal


In one dimension, the fractality of the fractal isn’t obvious. But you can try draggin’ out (or dragon out) the fractality of the fractal by ferning the wyrm, as it were. Suppose that after the point jumps halfway towards one or another of the two points, it’s rotated by some angle around the midpoint of the two original points. When you do that, the fractal becomes more and more obvious. In fact, it becomes what’s called a dragon curve (in Old English, “dragon” was wyrm or worm):

Fractal with angle = 5°


Fractal 10°


Fractal 15°


Fractal 20°


Fractal 25°


Fractal 30°


Fractal 35°


Fractal 40°


Fractal 45°


Fractal 50°


Fractal 55°


Fractal 60°


Fractal 0° to 60° (animated at ezGif)


But as the angle gets bigger, an interesting aesthetic question arises. When is the ferned wyrm, the dragon curve, at its most attractive? I’d say it’s when angle ≈ 55°:

Fractal 50°


Fractal 51°


Fractal 52°


Fractal 53°


Fractal 54°


Fractal 55°


Fractal 56°


Fractal 57°


Fractal 58°


Fractal 59°


Fractal 60°


Fractal 50° to 60° (animated)


At angle >= 57°, I think the dragon curve starts to look like some species of bristleworm, which are interesting but unattractive marine worms:

A bristleworm, Nereis virens (see polychaete at Wikipedia)


Finally, here’s what the ferned wyrm looks like in black-and-white and when it’s rotating:

Fractal 0° to 60° (b&w, animated)


Fractal 56° (rotating)


Fractal 56° (b&w, rotating)


Double fractal 56° (b&w, rotating)


Previously Pre-Posted (Please Peruse)…

Curvous Energy — a first look at dragon curves
Back to Drac’ — another look at dragon curves

Squaring the Triangle

It’s an interesting little exercise in elementary trigonometry to turn the Sierpiński triangle…

A Sierpiński triangle


…into its circular equivalent:

A Sierpiński trisc


You could call that a trisc, because it’s a triangle turned into a disc. And here’s triangle-and-trisc in one image:

Sierpiński triangle + Sierpiński trisc


But what’s the square equivalent of a Sierpiński triangle? This is:

Square from Sierpiński triangle


You can do that directly, as it were:

Sierpiński triangle → square


Or you can convert the triangle into a disc, then the disc into a square, like this:

Sierpiński triangle → trisc → square


Now try converting the triangle into a pentagon:

Pentagon from Sierpiński triangle


Sierpiński triangle → pentagon


Sierpiński triangle → trisc → pentagon


And a hexagon:

Hexagon from Sierpiński triangle


Sierpiński triangle → hexagon


Sierpiński triangle → trisc → hexagon


But you can also convert the Sierpiński trisc back into a Sierpiński triangle, then into a Sierpiński trisc again:

Sierpiński triangle → trisc → triangle → trisc


Sierpiński triangle → trisc → triangle → trisc (animated at Ezgif)


Sierpiński triangle → trisc → triangle → trisc (b&w)


Sierpiński triangle → trisc → triangle → trisc (b&w) (animated at Ezgif)


After triangles come squares. Here’s a shape called a T-square fractal:

T-square fractal


And here’s the circular equivalent of a T-square fractal:

T-square fractal → T-squisc


T-square fractal + T-squisc


If a disc from a triangle is a trisc, then a disc from a square is a squisc (it would be pentisc, hexisc, heptisc for pentagonal, hexagonal and heptagonal fractals). Here’s the octagonal equivalent of a T-square fractal:

Octagon from T-square fractal


As with the Sierpiński trisc, you can use the T-squisc to create the T-octagon:

T-square fractal → T-squisc → T-octagon (color)


Or you can convert the T-square directly into the T-octagon:

T-square fractal to T-octagon fractal

But using the squisc makes for interesting multiple images:


T-square fractal → T-squisc → T-octagon (b&w)


T-square fractal → T-squisc → T-octagon → T-squisc


T-square fractal → T-squisc → T-octagon → T-squisc (animated at Ezgif)


The conversions from polygon to polygon look best when the number of sides in the higher polygon are a multiple of the number of sides in the lower, like this:

Sierpiński triangle → Sierpiński hexagon → Sierpiński nonagon