How to draw the Apollonian Window

I have prepared data on circles in the Apollonian window in the text format collected here. The file has three columns that look like in the table below (it contains circles with curvatures up to 314).
xx yy b
0 0 1
1 0 2
-1 0 2
0 2 3
0 -2 3
3 4 6
-3 4 6
3 -4 6
-3 -4 6
8 6 11
etc etc etc
199 168 314
. The entries xx, yy and b denote:

xx = reduced x coordinate of a circle
yy = reduced y coordinate of a circle
b = curvature of a circle.

All entries are integer.

In order to draw the Apollonian window, you need to create three new columns:

xx yy b x y r
0 0 1 0 0 1
1 0 2 1/2 0 1/2
-1 0 2 -1/2 0 1/2
0 2 3 0 2/3 1/3
0 -2 3 0 -2/3 1/3
3 4 6 1/2 2/3 1/6
-3 4 6 -1/2 2/3 1/6
3 -4 6 1/2 -2/3 1/6
-3 -4 6 -1/2 -2/3 1/6
8 6 11 8/11 6/11 1/11
etc ... ... ... ... ...
199 168 314 199/314 168/314 1/314
The actual positions of the centers of the circles are (x,y) and their radii r may be obtained as ratios:


position x = xx / b,
position y = yy /b,
radius r = 1/b

Use them to draw your circles.


Download the file with the integer data: data.txt. It contains all circles (upper and lower) with curvatures up to 314 (that is -- down to the size of about 0.003 of the main bounding circle).

Back