Radix exapansion and Heighway (twin) dragon

This is related to pages here. Note, there may be bugs.
We take the base -1+i, and coefficients 0 or 1. But now we only take negative powers, so we get the fractional parts of the expansions.
layout: portrait/landscape (change for wide enough screens)
Presets:

Expansion (of coefficients parameter, and last added point, in powers of 2 and w=(-1+i) respectively):
0=0
0=0
0=0

Spiral: Grid: Invert colour:
Uniforms: png

Outline description

This is to illustrate what the set of fractional numbers in the base w=-1+i looks like. I.e., numbers with expansions in terms of sums of powers of, where all the powers are negative, and all the coefficients are 0 or -1.
"Expansion" above means the expansion for (the centre of) the last drawn point in the complex plane. This point is a polynomial in (-1-i)/2, with coefficients given by the coefficients of the binary expansion of the coefficients parameter (controlled by a slider). The way I've implemented this, points get redrawn multiple times (unless we stick to the parameter being odd, but drawing for all values makes some relationships clearer, so the colour4 allows both modes).
This is a modified version of the program at Radix expansion for the integers with respect to this base. That program filled in squares of integer size. A fractal dragon shape emerges, but also the whole plane gradually gets filled with the blocks, since all Gaussian integers have an expression in terms of positive powers of w and coefficients 0 or 1.
In order to see the Heighway dragon, you could work with the integer case as in the other program, but you have to scale down and rotate, since otherwise it just gets bigger and bigger, so we're not really getting something finite.
Or, we can work with fractional expansions, as in this program. This program is actually derived from the other one by rotating and scaling, i.e, for each expression given as a sum of positive powers of w, just divide by w to one more than the the highest power of w in the expression, to get something where all the terms are negative powers of w. The only "drawback" of applying this algorithm, the way I have implemented it, is that points will be drawn twice, though in some colour mode I leave out the repeats.
So, I draw dots for all points where the powers range from -1 to -N, where N ranges from 1 to 15, and is controlled by the Coefficients slider.
An ideal dot has zero area, so if I really just drew dots it would be very hard to see anything if there were only a finite number of dots of size zero. Therefore, I draw larger dots. In some colour schemes the dot size decreases as the power N increases, and in some modes the size remains the same.
The colours are somewhat just to look pretty, though they can be used to point out the structure of the set as a union of copies of itself etc.
In some modes, the negative powers of w will appear as black dots in the background; these are our "basis" in some sense (e.g., maybe if you're thinking of polynomials over a field of characteristic 2, and making these correspond to the points drawn), for all the points in the set.
As the value "coefficient" increases, the degree of accuracy of approximation to a point increases, so the fractal dragon shape gradually gets filled in.
You can choose to show a spiral. The spiral passes through the powers of w=(-1+i). The spiral line gives points on a line parameterised by f(t) = wt.
Colour4 option: at each stage a dot is added for the point we've got up to. Sometimes dots are added even if they are already there, and sometimes not (so changing coefficient doesn't add anything if the point is already marked in these cases, meaning no change for changing to even "coefficient".
  1. This is black dots, size decreaes with length of binary expansion of expression of point as a power series in w
  2. Same as above, but with a colour dot on top. Here dots are added even if they have already been drawn, since at each step I am adding everything in a scaled grid
  3. Same as above, but without the black dot
  4. Boxes instead of dots; max size for given grid (iteration level)
  5. Same as above but no repeats
  6. Little squares; repeats allowed
  7. Little squares, no repeats
  8. Little circles, no repeats, slightly too big by 15th iteration
  9. Little circles, no repeats, stay non-overlapping
  10. Circles depend on iteration level, no repeats
  11. Same as above, slightly smaller size circles
  12. little arrows pointing to the dot just added; the length is half the length of the power of w we're adding at this stage. With colour2=11, we colour everything the same for each level of adding a particular power of w
  13. dots only for powers of w
  14. dots only for powers of w, but invert colours, and only black and white
  15. dots only for things that differ from power of w by some contant determined by floor of colour 1 parameter. (fract(log2(x-floor(u_color.x)))==0.)
For other colour sliders, colour 1 multiplies the parameter value (coefficient slider) by the colour1 variable; colour 2 either rounds to nearest 2 to the power n (when colour2=n<11), or for colour2=11, rounds to nearest power of 2. Colour3 adds to the colour. (Add and multiply here mean I've got a colour function that passes through a rainbow of colours, and we add or mutlply the parameter used to determine the colour.)
A few examples of possible outputs (low res versions):