Jump to my Home Page Send me a message Check out stuff on GitHub Check out my photography on Instagram Check out my profile on LinkedIn Check me out on Facebook

The Apollonian Gasket

Apollonian Gasket Three Equal 3D White

Table Of Contents

Apollonian Gaskets

An Apollonian gasket fractal is generated by starting with a triple of mutually tangent circles, and successively filling in more circles, each tangent to another three. The result is sometimes called the curvilinear Sierpinski gasket. You can read all about it on wikipedia.

A single Apollonian gasket is fun, but four is better. ;) For many sets of three mutually tangent circles one may find an enclosing circle that is also mutually tangent. Now one may create four different Apollonian gaskets, one for each possible 3-tuple of circles. Here are a couple examples:

Apollonian Gasket Three Equal 2D Apollonian Gasket Two Equal 2D

If we turn each of the circles in a gasket into spheres, then we get the construction at the top of the page. Here are some examples:

Apollonian Gasket Three Equal 3D Apollonian Gasket Two Equal 3D Apollonian Gasket 588 3D

Generating Circles and Spheres

The first step in creating images like the ones above is to generate descriptions of the geometric objects (circle/sphere centers and radii). Practically speaking this means creating a files in some "standard" format with circle data for 2D renderings and spheres data for 3D renderings. The following little ruby script will generate SVG files for 2D data and POV-Ray include files for 3D data.


One need not explicitly render SVG files to view them because many software applications do that behind the scenes; however, one can obtain nice raster images from SVG files using ImageMagick, which uses inkscape internally, to convert them into PNG files. For the 3D scenes, I used via POV-Ray. The POV-Ray primary input files for the back background images are ap.pov and ap3.pov. The white background image was generated with apw.pov. Note these are the primary scene description files, and the sphere data is housed in "include" files generated by the script. For examples of how to use the rendering tools mentioned above, the makefile used to generate all the images on this page is probably the best source.

An IFS Approach

Above we have taken a constructive approach using a direct description of the circles for 2D images of the Apollonian Gasket. This is not the only way! One interesting alternative is an IFS frequently attributed to Kravchenko Alexei and Mekhontsev Dmitriy (I don't have a reference).

IFS for Apollonian Gasket

We can generate an image with a bit of code -- C++ this time. Note this code makes use of the mraster library.

The results

Apollonian Gasket Three Equal 2D From IFS


For a good, encyclopedic, introduction to the field in general, I strongly suggest "Chaos and Fractals: New Frontiers of Science" by Peitgen, Jurgens, and Saupe. This book is notable because of it's clear presentation and breadth of coverage. It's a great book to have around for the casual reader because it is broken up into semi self-contained sections that one can just pick up and read.

© 2009 Mitch Richling