A square Apollonian fractal
Nov. 28th, 2006 12:58 am
Draw a square; in the centre of it, draw a circle. In the largest remaining area of the square, draw a circle. Carry on until you run out of pixels; in the posted image I ran out of pixels fairly early, in the thing I've linked to you'll find the first 128 layers but you'll be able to see the smaller ones only if you've got an SVG editing application. Be warned that rendering images this complex makes Firefox rather lethargic, and may require a plug-in on lesser browsers; don't worry, it hasn't crashed.
If you set up the problem in a computer-algebra package, you find that the centres and radii of the circles, which are defined by sets of three simultaneous quadratic equations and so you might expect to live in an ever-deepening hierarchy of extension fields, are in fact all defined over Q(√ 2); the denominators don't even get too hairy, the largest in the first 128 layers is 257762.
If you don't have magma, you might want to see the log of the run; the layout of the log is obvious from the source code. I know the code's deeply inefficient, I'll need to improve that if I want to go more than a thousand iterations deep, but I don't know of languages which have both a decent Gröbner-basis library and reasonable handling of linked lists and priority queues. Writing priority queues in Magma is probably less painful than writing Gröbner-basis code in C++, but neither's very appealing at 1am, nor my first choice of entertainment at more reasonable hours.
If anyone's got the facility to print images onto large-poster-sized paper in a way in which millimetre-high letters are readable, I'd be interested to see what the highest-depth version I can generate looks like as a physical object; had I rather more energy than I think I do, I'd at least write a Java applet where you could zoom in and pan around ten thousand layers deep.
Pedant
Date: 2006-11-28 08:32 am (UTC)no subject
Date: 2006-11-28 09:15 am (UTC)Nice circles!
Re: Pedant
Date: 2006-11-28 10:34 am (UTC)no subject
Date: 2006-11-28 10:40 am (UTC)Illustrator also does this pretty fast, and renders it much better, but I suggest you use the text-anchor attribute to centre the numbers in one direction, and maybe see if one of the baseline attributes can be used to fix them in the other, then you can place them much more central relative to the circles. You also need to do a bit more size adjustment, the higher numbers are prone to overflowing their circles.
I could try using one of the a0 plotters at work, but I'm not going to print an entire page of red so you might want to change make the circle fill white.
no subject
Date: 2006-11-28 10:42 am (UTC)no subject
Date: 2006-11-28 10:47 am (UTC)no subject
Date: 2006-11-28 01:28 pm (UTC)I think an effect both pretty and not likely to make the plotter run entirely out of pink might be to draw the square, and then the circles filled in white with no border at 90% of the full radius, so the result looks like a bit of metal with lots of artfully-machined holes in it, like the brakes of an expensive sports car.
Or pure edges: what are the thinnest lines that your plotters can draw sensibly?
no subject
Date: 2006-11-28 02:31 pm (UTC)Heck, if you can't get it to work I'll write a script in NodeBox to do it—procedural graphic design in Python is great.
no subject
Date: 2006-11-28 03:40 pm (UTC)no subject
Date: 2006-11-28 03:58 pm (UTC)A0 versions with nice thinness
Date: 2006-11-29 02:03 pm (UTC)http://www.globalphasing.com/~twomack/holy.svg
is the cyan plate with holes in with 1mm borders around them
http://www.globalphasing.com/~twomack/unholy.svg
is the data with 0.1mm borders and holes down to 0.2mm diameter
(both with the image 800mm across for A0 printing)
and http://www.globalphasing.com/~twomack/bigset.cpp has the data embedded in it if you want to process more
Re: A0 versions with nice thinness
Date: 2006-11-29 02:49 pm (UTC)Re: Pedant
Date: 2006-11-29 03:09 pm (UTC)Re: A0 versions with nice thinness
Date: 2006-11-29 03:10 pm (UTC)Uploaded files for web pages should go in www:public_html/
Uploaded files for web pages should go in www:public_html/
Uploaded files for web pages should go in www:public_html/
Uploaded files for web pages should go in www:public_html/
I've moved them there now. 404-less.
Re: A0 versions with nice thinness
Date: 2006-11-29 03:47 pm (UTC)I'll whack those through illustrator tonight and layout a coupe of test plots to see what works best when printed.
Re: Pedant
Date: 2006-11-29 04:30 pm (UTC)Eye-searing monstrosities 'r' us!
Re: A0 versions with nice thinness
Date: 2006-12-04 11:53 am (UTC)I could do even bigger, as we have a five foot wide roll on one of the plotters, but that start to become difficult to transport.