search
Monday, 2017 July 3, 19:43 — eye-candy, mathematics

mutant dragons

In 2007 I thought of a pretty way to paint a square so that all pixels are different, but similar colors are clustered. For each pixel, set x,y to its coordinates; if their sum is odd, set the low bit of one of the color channels to 1. Replace x,y with (-x+y)>>1, (-x-y)>>1; this has the effect of rotating the grid by 3/8 turn and shrinking it by a factor of √2, so that the former even points, which formed a larger oblique grid, now fall on the original grid, and the odd points have their new half-coordinates truncated away. Repeat until a bit has been assigned to each bit of the three color channels.

(More concisely: considering the pixel’s coordinates as a complex number, express it as a bit string in base (-1+i).)

Colors that match in their higher bits form twindragon fractals, thus:

In 2012, I thought: what if the rotation alternates clockwise and counterclockwise?

A bit on the boring side.

But in 2017, I thought: what about less trivial sequences?

Some of these have a Deco flavor.

These pictures use only 17 bits; the three low bits of blue, and the two low bits of green and red, are all zero here. The repeat unit is a tilted square whose edge length is 2**(17/2) pixels; I did that so that the neighborhood of the corner is repeated in the middle.