Circlized checkerboard

44 Views Asked by At

The function $\varphi$ defined by $$ \varphi(z) = \sqrt{i} \, F\bigl(i \sinh^{-1}(\sqrt{i} \, z) \,|\, -1 \bigr). $$ where $F(z | m)$ is the incomplete elliptic integral of the first kind, maps the unit disk to the square with vertices $C \times (\pm 1 \pm i)$ where $C = \varphi(1) \approx 0.92703733865...$, and it is conformal.

I'm trying to use this function to map a checkerboard to a circle. I'm using this pseudo-code:

function colormap(z)
    x = 3 * real(z)
    y = 3 * imag(z)
    out = modulo(x, 2) < 1 ?
        ( modulo(y, 2) < 1 ? "black" : "white" ) :
        ( modulo(y, 2) < 1 ? "white" : "black" )
    return out
end
Z = {0, 0.001, 0.002, ..., 1} x {0, 0.001, 0.002, ..., 1}
for z in Z
    if modulus(z) > 1
        plot( "gray" ) at z
    else
        plot( colormap( phi(z) / 0.92703733865 ) ) at z

Here is the result I get:

enter image description here

I don't understand why the transformed squares at the corners of the checkerboard have only three sides and not four. Could you help me to understand? Am I doing something wrong?