# Complex Base Tiles

> Drag the base β: all the binary numerals of a complex base, as points, fill its radix tile. At β = −1 + i the tile is the twindragon.

A computer counts with 0 and 1. In 1964 and 1965, S. Khmelnik and Walter Penney found that in the base $-1 + i$, 0 and 1 write every complex number $a + bi$ with whole $a$ and $b$, with no minus sign. A complex number ($i^2 = -1$) is a point of the plane.

In base 2, the numerals $0.d_1 d_2 d_3\ldots$ fill the interval from 0 to 1. A complex $\beta$ can be a base too: the numeral $0.d_1 d_2 \ldots d_L$ is the number $\sum_{k=1}^{L} d_k \beta^{-k}$, the sum of the terms for $k = 1$ to $L$. This document draws all $2^L$ numerals with $L$ digits as points. They fill the radix tile of $\beta$: the numbers with no digit before the radix point.

For $\beta = -1 + i$ the tile is the twindragon, which Chandler Davis and Donald Knuth described in 1970. Drag the point $\beta$ to $(1, 1)$ for the twindragon turned; $\beta = i\sqrt{2}$ gives a rectangle, and $\beta = (-1 + i\sqrt{7})/2$ the tame twindragon. With $|\beta| < 1$ the powers $\beta^{-k}$ grow, and the points leave the view.

The rows are real. The point of the integer $n$ takes the bits of $n$ as digits, $d(n, k) = \operatorname{mod}(\lfloor n/2^{k-1} \rfloor, 2)$. With $R = 1/|\beta|$ and $A = -\arg \beta$, the point is $X(n) = \sum_k d(n, k) R^k \cos(kA)$, $Y(n) = \sum_k d(n, k) R^k \sin(kA)$. The two colors split the numerals by their first digit $d_1$; each is a copy of the whole tile, shrunk by the factor $1/\beta$, and the two copies tile the whole. Drag $L$ from 1 to 13: each new digit splits every piece in two.

*After TheGrayCuber's complex-bases page on Notatio.*

- [Open the interactive version](https://graph-paper.io/showcase/en/complex-base-tiles)
- [Learn more on Wikipedia](https://en.wikipedia.org/wiki/Complex-base_system)
