## Apollonian gaskets and circle inversion fractals

Recall the definition of an iterated function system (IFS), and how on occasion, their attractors are fractal sets. What happens when we allow more general functions instead of mere affine maps?

The key to the design of this amazing fractal is in the notion of limit sets of circle inversions.

The definition of inversion with respect to a circle with center and radius depends on the location of with respect to the circle:

- Given any point outside of the disk bounded by consider the segment that joins with and the only circle that has this segment as diameter. The two circles intersect at points The intersection of the segments and is the inversion of
- The inversion of a point inside the disk bounded by is obtained in a similar fashion: Consider the ray originating at that goes through and its perpendicular through The latter intersects the circle at points The only circle that goes through and intersects the ray at the inversion of
- For any point in the circle it is

Note that the circle inversion is an *involution*: for all One must therefore be careful when designing IFS’s with inversions; usually we include a mechanism that prevents such a map to be called twice on a row.

Let us examine a few basic examples:

## An IFS consisting on circle inversions with respect to two disjoint disks

Choose two disjoint disks, construct an IFS containing the two corresponding circle inversions, pick a random point outside the two disks, and compute the orbit of this point by mapping each output through alternate inversions (in order to avoid the involution producing infinite loops). As you can see in the figure below, the limit seems to be a very simple set: two points. Can you find their location analytically?

How will the attractor set change if the two disks are tangent? And if the two disks intersect at a larger set?

## An IFS consisting on circle inversions with respect to three mutually disjoint disks

We obtain our first fractal: It has the structure of a Cantor set, supported on a circle. Can you find the center and radius of that circle?

## An IFS consisting on circle inversions with respect to five mutually disjoint disks

This is when the fun starts. Do the attractors for the circle inversion of these two examples with five disks look familiar?

## Miscellaneous

The question is, how many disks, and which configuration must they observe so that the corresponding attractor is a proper Apollonian gasket? (a fractal generated from triples of circles, where each circle is tangent to the other two)

Let us go one step further, and allow in the IFS more general Möbius transformations. For example, a (modified) IFS with the three maps and defined below, offers a possible solution:

A naïve code to obtain this fractal is shown: Note that we have not included any mechanism to prevent any inversion to repeat itself in consecutive steps—that way we do not avoid having points that go back and forth through the same circle inversion.

from numpy import * import matplotlib.pyplot def ifms(iterations): location=0+0*i X,Y=[],[] s=sqrt(3.0) for step in range(iterations): location = 3/(1+s-location)-(1+s)/(2+s) choice=random.randint(3) if choice==1: location=f1*(-1+i*s)/2 elif choice==2: location=f1*(-1-i*s)/2 X.append(float32(location.real())) Y.append(float32(location.imag())) return X,Y matplotlib.pyplot.figure() matplotlib.pyplot.axis('equal') X,Y=ifms(400000) matplotlib.pyplot.plot(X,Y,'.k',ls='', markersize=1.0) matplotlib.pyplot.savefig('/Users/blanco/Desktop/pointplot.png')

thought you might be interested in viewing my loosely applied application of tangent circle packing…

Thanks for this interesting article. It was just the information I was looking for. I used it to create the following fractal: http://fav.me/d843tif

That is just impressive! Thanks for sharing.