How to create an apollonian gasket

wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, 15 people, some anonymous, worked to edit and improve it over time.

This article has been viewed 48,142 times.

An Apollonian Gasket is a type of fractal image that is formed from a collection of ever-shrinking circles contained within a single large circle. Each circle in the Apollonian Gasket is tangent to the adjacent circles – in other words, the circles in the Apollonian Gasket make contact at infinitely small points. Named for the Greek mathematician Apollonius of Perga, this type of fractal can be drawn (by hand or by computer) to reasonable degree of complexity, forming a beautiful, striking image. See Step 1 below to get started.

To be perfectly clear, if you’re simply interested in drawing an Apollonian Gasket, it’s not essential to research the math principles behind the fractal. However, if you’d like a deeper understanding of Apollonian Gaskets, it’s important to understand the definitions of several concepts we’ll use when discussing them.

How to create an apollonian gasket

How to create an apollonian gasket

Apollonian Gaskets take the form of beautiful fractal arrangements of shrinking circles. Mathematically, Apollonian Gaskets have infinite complexity, but, whether you’re using a computer drawing program or traditional drawing tools, you’ll eventually reach a point at which it’s impossible to draw circles any smaller. Note that the more precisely you draw your circles, the more you’ll be able to fit in your Gasket.

Introduction: How to Build an Apollonian Gasket End Table

An Apollonian Gasket is a fractal generated by using tangent circles to fill an area. The circles decrease in size and can become infinitely small if the fractal is continued. The table uses increasing numbers of circles in each layer to create an end table with various depths. It was inspired by my current math research on Apollonian Networks and designed with consideration of my senior capstone project on automotive furniture.

Supplies

All of the materials I used were scraps. The table can be made with various thicknesses of wood, however, dimensions may need to be changed if you do so. The materials I used were:

  • Titebond Premium Wood Glue
  • 120/180 Grit Sandblock
  • 9/16″ Spade Drill Bit
  • 1 1/2″ Hole Saw Bit
  • Dewalt Drill
  • Bandsaw
  • Spindle Sander
  • Table Sander
  • Sandpaper
  • Clamps
  • Scrap wood (large sheets and 1″x1″ poles)
  • Black Spray Paint

Step 1: Design Apollonian Gasket

I designed my Apollonian Gasket in Revit, however, you can use this link to design one without needing math. The outer edge normally is circular but I used a decagon for leg placement reasons. To design in Revit continue with the steps below.

  1. Draw an inscribed polygon extrusion with 10 sides, an 8″ distance, and 1/4″ depth (Don’t worry if your wood is not this thick it won’t matter for the design)
  2. Draw the circle void extrusions with a 1/4″ depth. The diameters are given below from largest to smallest. Each circle should approximately 1/4″ away from any other circle. The positioning of the circles correlates to the apollonian gasket provided.
    1. Circles #2 have a 7 1/4″ diameter. The circles should be 1/8″ away from the center of the decagon and 9/32″ from the edge of the decagon.
    2. Circles #3 have a 4 3/4″ diameter.
    3. Circles #6 have a 2 1/4″ diameter.
    4. Circles #11 have a 1 1/8″ diameter.
    5. Circles #14 have a 13/16″ diameter.
    6. Circles #15 have a 3/4″ diameter.
  3. Project the design onto a piece of craft paper at the scaled size and then trace it.
  4. Cut out the design including the void extrusions.

Step 2: Draw and Cut Layers of Table

Using the template created in step one, sketch out each layer with the correct holes.

  1. Circles #2
  2. Circles #2 and 3
  3. Circles #2, 3, and 6
  4. All circles

After the design has been drawn, cut each decagon out leaving some room on the edge for later sanding.

Step 3: Cut and Sand Gasket Holes

Use the 9/16″ drill bit to create holes in the small circles on layer 4 and use the 1 1/2″ drill bit to create holes in all of the other circles on each layer. When drilling the holes, try to drill near the center of each circle. Then, use the jigsaw to cut out the circles to the proper size. The smaller circles should not require the jigsaw as they are close enough to sand down to size. Lastly, use a spindle sander for fast and accurate sanding of each circle. Sand as close to the design line as possible without going past it.

Step 4: Glue Layers Together

Now that each layer is cut out and sanded, the tabletop can be glued together. Using any type of wood glue, apply a layer of glue to the side of layer one with the design sketched on it. Then, place layer two on top of layer one, design side up. Repeat this with layers 3 and 4 then clamp the 4 layers together. Use one camp at each corner of the decagon and at least one in the center. Allow to dry overnight or as long as your wood glue suggests.

Step 5: Sand Imperfections

With the tabletop in one piece, it is now time to sand away imperfections in the layers. I began with the edges and sanded them even on the table sander. Next, I sanded the two largest circles on the spindle sander. The rest of the circles were sanded down with a Dremel sander and sandpaper. When done all the circles should line up evenly with the other layers.

Step 6: Cutting the Legs

With the tabletop built, the next thing to do is make the legs. I began with 1″ by 1″ wood pole scraps and cut them into 19″ long poles, you will need 10 poles in total. Then, make a mark at 16″ and draw a line from the opposite corner to the mark (as seen in the pictures). This is roughly a 75-degree angle which I cut using a bandsaw. On the other side, cut a 5-degree angle with the longest side facing outward (see pictures for clarification).

Step 7: Making the Base

To make the base, another decagon will need to be cut out and sanded, however, no holes are required. Once the decagon is ready, apply glue to the 5-degree side of the pole and place it at any corner of the decagon with the 75-degree angle facing another corner. Then, nail or screw it in. If you find trouble keeping the legs in position while nailing try using clamps to hold it in place. Continue the legs alternating the way the 75-degree angle is facing and rotating around the decagon.

Step 8: Gluing Into One Piece

This set is easy, just glue the base to the tabletop. Pay extra attention to how the decagons line up and then clamp the two pieces together tightly. Let dry overnight or however long your wood glue recommends. After drying, sand down any rough edges.

Step 9: Spray Painting

While you can leave your end table the way it is, I have chosen to spray paint mine black. When spray painting, don’t spray too close to the table and apply thin layers at a time. You’ll want to go over it multiple times to get a true black color. Then, you’re done! You have made a table.

Since angles are preserved under inversion in circle (see Non-Euclidean Geometry ‐ Inversion in Circle), tangency is also preserved. Starting with five tangent circles, you can make a pattern like the Apollonian gasket by repeatedly invert in circles.

Start with five circles such that each circle is tangent to at least three of the others (see Geometry – Circumscribed and Inscribed Circles). There are six places where one can make a new circle (the gray regions in the picture below). The new circle should be tangent to three of the original circles. For each such new circle there will be three new regions where one can make new circles. The process can be repeated.

How to create an apollonian gasketFive Soddy circles. The largest circle and the smallest circle are each other reflections in the yellow circle.

Repeating the procedure of making new circles, that are tangent to three other circles, will produce a circle fractal called an Apollonian gasket.

Geometrical construction of an Apollonian gasket

When making a geometrical construction of an Apollonian gasket, new circles are created from triplets of circles by using circle inversion. To ensure that the tangency is preserved, some properties of tangent circles under circle inversion are used.

Every circle in a triplet of mutually tangent circles should remain unaltered after reflection

Given three circles that are mutually tangent to each other, make a circle though their intersection points. The circle through intersection points is called c in the picture above. c is the circle used for making new circles through circle inversion.

The picture above depicts what it looks like in the two cases that give rise to three intersection points. Other cases of mutually tangent circles are also possible, but those will only yield one or two intersection points.

Consider what happens when the circle a is reflected in c. The points A and B lie on c, they are therefore not altered when reflected in c. Since circle inversion preserves angles, the right angles at A and B will still be right angles after the reflection. The reflection of a in c, is a circle through the same points A and B. The reflected circle will have tangents at A and B that are perpendicular the tangents of c at A and B. Therefore the reflected circle must be the same as the original circle a.

Tangency is preserved

Create a circle through the intersection points of three mutually tangent circles. The three tangent circles are blue in the picture below. In order to construct a circle tangent to the three circles, note that there already is a circle in the construction that is tangent to them, this is the red circle in the picture below. If the circles a, b, c, d, were reflected in the yellow circle; the reflections of a, b, and c, would be the same circles as a, b, c. Furthermore, the reflection of d would be tangent to all three, since tangency is preserved when reflecting in circles. Hence, by reflecting the red circle d, a new circle is created that is tangent to all three blue circles.

How to create an apollonian gasketIdentify the circle tangent to the three blue circles. Reflect it in the yellow circle.

The easiest way to do this in GeoGebra is to use the spreadsheet. The circle through the intersection points, and the reflection that follows, can be made using the commands:

The original circles can be renamed to A1. A5; they will then automatically appear in the first five cells under column A in the spreadsheet. The circle through the intersection points is not needed, it will not be used again. It is possible to write the above as one single command.

Of the six regions that are to be packed by new circles, three lie adjacent to the largest circle, and three are adjacent to the smallest circle. Keep packing circles in the region between the circles a, b, c. If doing it in the spreadsheet, it is easy to copy the code to fill in the other two regions adjacent to the largest circle c.

How to create an apollonian gasketAnd repeat!

When the outer regions, those that are adjacent to the largest circle, have been filled; all the newly created circles can be reflected to fill the inner regions, those adjacent to the smallest circle.

Apollonian gasket as a limit set

An Apollonian gasket can also be generated as a so-called limit set of a so-called Schottky group made by pairing tangent circles. By slightly changing the circles/Schottky group, the limit set can be made to look like a twisting gasket. Drag the slider to make a twisted Apollonian gasket.

It is also possible to make a construction using Descartes’ Theorem. In that case, a relation between the curvature of the circles is used, and the points are represented as complex numbers. See Wikipedia: Descartes’ Theorem

To understand how to make an Apollonian gasket as a limit set, read the book Indra’s Pearls: The Vision of Felix Klein by David Mumford, Caroline Series and David Wright.

by Malin Christersson under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 Sweden License

Given three mutually tangent circles, we can always find two more circles which are tangent to all three of those. These two are called Apollonian circles. Note that one of the Apollonian circles might actually be around the three initial circles.

Starting from three tangent circles, we can create a fractal called an Apollonian gasket, by the following process:

  1. Call the initial 3 circles the parent circles
  2. Find the parent circles’ two Apollonian circles
  3. For each Apollonian circle:
    1. For each pair of the three pairs of parent circles:
      1. Call the Apollonian circle and the two parent circles the new set of parent circles and start over from step 2.

E.g. starting with circles of equal size, we get:

How to create an apollonian gasket

Image found on Wikipedia

There’s one more bit of notation we need. If we have a circle of radius r with centre (x, y), we can define it’s curvature as k = ±1/r. Usually k will be positive, but we can use negative k to denote the circle that encloses all the other circles in the gasket (i.e. all tangents touch that circle from the inside). Then we can specify a circle with a triplet of numbers: (k, x*k, y*k).

For the purpose of this question, we will assume positive integer k and rational x and y.

Further examples for such circles can be found in the Wikipedia article.

There’s also some interesting stuff about integral gaskets in this article (among other fun things with circles).

The Challenge

You will be given 4 circle specifications, each of which will look like (14, 28/35, -112/105) . You can use any list format and division operator that is convenient, such that you can simply eval the input if you wish to. You may assume that the 4 circles are indeed tangent to each other, and that the first of them has negative curvature. That means you are already given the surrounding Apollonian circle of the other three. For a list of valid example inputs, see the bottom of the challenge.

Write a program or function which, given this input, draws an Apollonian gasket.

You may take input via function argument, ARGV or STDIN and either render the fractal on screen or write it to an image file in a format of your choice.

If the resulting image is rasterised, it must be at least 400 pixels on each side, with less than 20% padding around the largest circle. You may stop recursing when you reach circles whose radius is less than a 400th of the largest input circle, or circles which are smaller than a pixel, whichever happens first.

You must draw only circle outlines, not full discs, but the colours of background and lines are your choice. The outlines must not be wider than a 200th of the outer circles diameter.

This is code golf, so the shortest answer (in bytes) wins.

Example Inputs

Here are all integral gaskets from the Wikipedia article converted to the prescribed input format:

The above image is an example of an Appollonian Gasket, otherwise know as close-packed circles. Technically the close packing should take place in a single large circle as opposed to the entire rectangular canvas, but we’ll ignore that minor detail. This post will show how to create close packed circle abstractions using MSG processors.

How to create an apollonian gasket

The image gallery below shows the simple MSG preset used to build the above image.
How to create an apollonian gasket
How to create an apollonian gasket
How to create an apollonian gasket

Note that there are just 2 processors used to create this entire class of abstract imagery with close packing properties. The first SetToValue processor is used to set the ROut image stream to a flat gray color. The second 3C Abstract7 CP processor is what generated the close packed circles. As previously discussed here, 3C refers to a 3 channel or color output processor, and CP refers to a processor that uses a color palette stream for coloring the abstract shapes it generates.

The 3C Abstract7 CP processor overlays close packed circles on top of an existign 3 channel image stream. We use the ROut image stream as the attached stream for all 3 color input ports (In R,In G,In B) for the 3C Abstract7 CP processor. We do this because after the first SetToValue processor is run, the ROut processor is the only image stream set to a determinate value (a flat gray image in this particular case). The 3 color output streams for the 3C Abstract7 CP processor (Out R,Out G,Out B) are attached to the 3 color output image streams for the MSG preset (ROut,GOut,BOut).

We could have used any of the 3 color palette streams associated with a MSG preset, we chose the first ColorPalette to attache to the In Color Palette port. The coloring of the abstract shapes generated by the 3C Abstract7 CP processor is a function of the colors in the Color Palette stream and the individual editable parameters associated with the processor.

The term Apollonian Gasket refers to a specific type of fractal image generate by close packed circles. The image is fractal due to the self similar nature of the image at different scales. By close packed we mean that the individual circles touch but never overlap. Since this is Studio Artist, we added all kinds of shape variations based on the close packing model in addition to just close packed circles. the 3rd gallery image above shows off different mutated variations of this simple preset. Note that the processor is capable of creating all kinds of shape variations besides a purest apollonian gasket close packed circle.

The positioning of the close packed circles or other shapes is randomly determined with the MSG preset we built above. Tomorrow we’ll discuss how to modulate or control the positioning of the packing to create variations on this kind of effect.

Apollonian gaskets = They are planar fractals generated from triples of circles, where each circle is tangent to the other two. In his drawing of the gasket, we start with two externally tangent circles which diameter is D1 and D2. Then we add a third circle which diameter is D1+D2 and to which the two original circles are internally tangent. This is the first generation of circles. Each subsequent generation of circles is constructed by applying the following scheme: For any three circles A, B C of any previous generations which are tangent to each other a new circle is constructed which is tangent to A,B,C. The new circle must differ from all circles constructed so far. When a generation is complete, i.e no other circle can be added, then the next generation of circles can start being constructed.

There is an additional stopping rule which prevents from generating infinitesimally small circles. A circle can be added to the gasket if and only if the lenght of its diameter is least minD which is a fixed positive value.

Input consists of one line with three decimal numbers D1, D2 and minD. The number are separated by spaces. The format is usual decimal format (see also the examples bellow) with no exponent part. It holds that 1.0 ≤ D1, D2 ≤ 1000.0, 0.001 ≤ minD ≤ D1+D2.

Ouput consists of one text line containing two decimal numbers L1 and L2. L1 represents the sum of areas of all circles in the gasket except for the bigggest circle. L2 represents the sum of perimeters of all circles in tin the gasket except for the bigggest circle. Both output values are rounded to 6 decimal digits. Decimal digits must be always present in the output even if some of them are zeros. Maximim output value is less than 107.

Input

Output

How to create an apollonian gasket

How to create an apollonian gasket2

For given D1 and D2, I create this two circles like this (first iteration):

UPDATE:

So, solution is based on Descartes’ theorem. We well work with radius, not diameter, and Curvature, with is 1/r . We will use double for all calculation, but if you work with significantly small numbers, I would prefer BigDecimal. It will slow algorithm, and you should use external method for finding square root, because BigDecimal doesn’t have any.

For given D1, D2, minD we modify code above for efficiency:

So, first step looks like this: How to create an apollonian gasket

Next step looks a little bit more complicated.

Assume we want to write a recursion to solve this problem, and according to Descartes’ theorem, for given curvatures of three circles, tangent to each other, (pic. below) How to create an apollonian gasket, we could find curvatures of two circles, but for our purposes, we need only small one, so, we can simplify formula to

Lets take a look at Apollonian gaskets again: try to play with it. See? It is same gaskets, but with different start condition. And whats more important for us, is that it is symmetrical! So, we will calculate just a half, and then multiply result by two! Lets write a recursion! Inputs will be curvatures of three circles. No output, we will use change our global variables.

To find the result, we will use formulas to calculate area and perimeter of circle. Perimeter is length of circumference and equal to . Area is equal to , as you already know, because we already calculated it in previous step, otherwise we had to store every radius and do more calculations.

But we forget about our first two circles! Let’s fix it!

And there is always a room for improvement. For example, to use IEEE 754 in better way, I assume you will use 1. / x instead of 1 / x .

Exploring the interplay between Mathematics and Art

  • 3D Printing for the Visually Impaired
  • A Plurality of Polyhedra
  • Apollonian Gaskets with Grasshopper
  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.com

My son and I were recently watching Vi Hart’s wonderful “Doodling in Math Class” Video on Infinity Elephants. Around 1:30 in the video she starts talking about how to draw an Apollonian Gasket in a triangle:

This got me wondering about how to code this object. It’s not a new challenge. Lot’s of people have done it. You can even search Shapeways to find some amazing 3-D printed, 3-dimensional versions. But I couldn’t find much info on how its done. I did find an old discussion here where they were wondering how to do the same thing. (Nothing really useful there, except some nice references to hyperbolic Geometry-specifically a little paper by David Dumas-with a dead link to a program written by Curt McMullen.)

I’ll use Python when I have to, but my preferred method of construction is with the visual programming language Grasshopper, a plug-in for the CAD program Rhinoceros3D. Clearly, the object I was trying to replicate is fractal, which means recursion is going to be unavoidable. That’s easy enough in Python, but it sucks in Grasshopper. The only way I know to do recursion in Grasshopper is with a 3rd party component. I think there are multiple options. The one I use is called “Hoopsnake.” It does the job, but for this kind of thing it’s extremely slooowwww. That’s OK, because to replicate the drawing in Vi’s video, I’m only going to do about 5 iterations.

It took a bit of experimenting, but eventually I got it down to a surprisingly small Grasshopper definition. The key was to use the CircleTanTanTan component, which automatically finds the circle that is tangent to three different input curves. For the Grasshopper savvy out there, here’s my definition:

Here’s what it produces….

…exactly what I wanted!!

Once I had that, it wasn’t hard to make all kinds of designs. Here are some Apollonian Spheres.

I even experimented with an Apollonian Pocket Watch Design!

In the earlier post “Apollonian gasket as a fractal in tiled hyperbolic space” I have already discussed the Apollonian gasket. There, I began with three touching circles that define an ideal triangle with vanishing corner angles. Multiple inversion at the circles creates a Poincaré disc model of a hyperbolic space. It is tiled by images of the triangle. The limit set of the inversions is exactly the boundary of the disc. Adding a fourth circle ,which touches the other three, gives the Apollonian gasket as the limit set of the inversions in all four circles. Seen as a two-dimensional object, it is a fractal decoration of the tiled hyperbolic disc that resulted from the first three circles. On the other hand, in “Apollonian gasket as a spherical fractal with tetrahedral symmetry” I have shown that the Apollonian gasket is also a fractal decoration of a spherical surface with tetrahedral symmetry. Both are related by a stereographic projection.

This becomes more interesting if we think in three dimensions. We can see the four touching circles as equators of spheres. The plane going through their centers is the boundary of two Poincaré half-space models of three-dimensional hyperbolic space. These models lie on the two sides of the plane. The four spheres are flat planes in the corresponding hyperbolic spaces. Multiple inversion in the spheres creates a periodic tiling of these spaces and a non-periodic tiling of their mutual boundary. The limit set is obviously the Apollonian gasket.

As mentioned before, we can project the Apollonian gasket on the surface of a sphere using the stereographic projection. But this projection only maps two-dimensional surfaces. It would be useful if we could somehow use the stereographic projection for the entire three-dimensional space. Considering only the surface of a sphere, its stereographic projection to a plane gives the same result as an inversion in a mapping sphere, which has the same center as the stereographic projection. The radius of the mapping sphere is then directly related to the position of the plane of projection. Typically, the mapping sphere intersects the projected spherical surface in this plane. The first figure shows an example. The center of projection is the north pole of the sphere and the plane of projection goes through its center. The intersection with the mapping sphere is then the equator of the spherical surface and the radius of the mapping sphere is larger by a factor of the square root of two. Using the inversion in the sphere, we can extend the stereographic projection to the entire three-dimensional space. That is exactly what we need.

We now use an additional inverting sphere to map the four spheres and the hyperbolic model they generate. The center of this sphere lies above the center of the Apollonian gasket. It is closer to the smaller sphere than the three other spheres. Thus, inversion in the additional mapping sphere increases the size of the smaller sphere in comparison to the three larger spheres and it is possible to make that all four spheres get the same size after inversion. As they are touching each other, the distances between their centers are then all the same. Then, the centers of the three spheres lie on the corners of a tetrahedron, see the second figure. The spheres touch in the middle of its edges. A small part of the space inside the tetrahedron lies between the four spheres. It is useful to think that this is a tetrahedron with curved sides, which are parts of the surfaces of the spheres. This tetrahedron has no corners. The black regions show its intersection with the large tetrahedron. Yet, these tetrahedrons are dual to each other. Multiple inversion in the four spheres creates a Poincaré ball model of hyperbolic space. It is tiled by the curved tetrahedron between the four spheres. The surface of the ball model is drawn in the second figure in red color. Note that the tiling tetrahedron has no corners inside the ball or on its surface. Thus it is a “hyperideal” tetrahedron.

The last figure shows the surface of the ball model. The intersection with the tiling tetrahedron is again shown in black and the intersection with the four inverting spheres in dark blue. Note that all points get mapped into the black region. Points requiring more iterations get a lighter shade of blue. Thus the white color approximates the limit set, which is indeed an Apollonian gasket.

We see that using four spheres is the most symmetric way for getting the Apollonian gasket. Actually, this is the starting point for further research. What can we get from inverting spheres at the corners of other (regular) polyhedrons? This gives interesting variations on the Apollonian gasket. Does an additional inverting sphere at the center result in a fractal space filling structure of Poincaré ball models? We need a tiling tetrahedron with real corners to do that. This might also be seen as five four-dimensional inverting spheres at the corners of a four-dimensional simplex, which is sometimes called a “hyper-thetrahedron”. It gives a much more complicated structure than a three-dimensional “Apollonian gasket”. More results in future posts.

Okay , is there a way to find the radius of the nth circle in a apollonian gasket ..

Something like this

How to create an apollonian gasket

Its like simple case of apollonian gasket ..

I found from descartes’ theorem

$R_n = 2\cdot\sqrt< R_\cdot R_1 + R_n-1\cdot R_2 + R_1\cdot R_2> +R_ + R_1 +R_2 $

I have the values of $R_1,R_2,R_3,R_4$ ..

where $R_n$ is the curvature and not the radius So I have this question

  1. Is there anywhere this will fail ?
  2. Can it be more simplified to get $R_n$ in terms $n$
  3. Is there any faster way to calculate for large numbers as $n=10^8$

1 Answer 1

Sure, there is a way.

To simplify the formula, I will relabel your circles as follows.

  • Let $S_a$ and $S_b$ be your circle $C_1$ and $C_2$.
  • Let $S_0, S_1, S_2, \ldots$ be your circle $C_3, C_4, C_5, \ldots$.
  • Given $C_1, C_2, C_3$, there are two possible configurations of $C_4$.
    Let $S_<-1>$ be the other possible configuration of $C_4$ differ from $S_<1>$.

Let $r_n$ be the radius of circle $S_n$ where $n = a, b$ or $\ge -1$ and $\rho_n = \frac<1>$.

Recall $S_a$ is the outer circle. If we apply Descartes circle theorem to circles $S_a, S_b, S_, S_$ for $n \ge 0$, we have

$$ 2( \rho_a^2 + \rho_b^2 + \rho_n^2 + \rho_^2 ) = (-\rho_a + \rho_b + \rho_n + \rho_)^2$$

So $\rho_$ are the two roots of a quadratic equation.

$$\rho^2 – 2(-\rho_a + \rho_b + \rho_n ) \rho + \left(2(\rho_a^2 + \rho_b^2 + \rho_n^2 ) – (-\rho_a + \rho_b + \rho_n)^2\right) = 0\tag<*1>$$ This implies $$\rho_-2\rho_n + \rho_ = 2A \quad\text< where >\quad A = \rho_b – \rho_a = \frac<1> – \frac<1>$$

This is a linear recurrence relation in $\rho_n$ and its general solution has the form $$\rho_ = A n^2 + B n + C$$ In particular, we have $$\begin \rho_1 &= A + B + C\\ \rho_0 &= C\\ \rho_ <-1>&= A – B + C\\ \end \implies \begin B &= \frac12\left( \rho_1 – \rho_ <-1>\right)\\ C &= \rho_0 \end$$ This leads to

$$\rho_n = (\rho_b – \rho_a) n^2 + \frac12 (\rho_1 – \rho_<-1>) n + \rho_0$$

You can obtain the values of $\rho_<\pm 1>$ by solving the quadratic equation $(*1)$ for $n = 0$. To match your diagram, $\rho_1$ should be the smaller one of the two roots.

These are some python classes and functions for calculating Apollonian Gaskets and saving them as svg. For an overview about this mathematical object, see wikipedia.

The code is split into the following files:

  • apollon.py contains all the pure math stuff
  • coloring.py contains helpers for color mapping
  • ag.py is a command-line tool for generating Apollonian Gaskets
  • index.cgi is an interactive online cgi version
  • colorbrewer.json contains the color schemes, copied from https://gist.github.com/jsundram/6004447#file-colorbrewer-json

Run ./ag.py c1 c2 c3 where c1, c2, c3 are the (positive) curvatures of the starting circles. Please also see the –help option.

Note: The method used to calculate the circles is recursive. For depth d, 2*3^ circles are created. It is usually safe to do this up to d=10, but with higher values you can reach the limit of your RAM. Because of this, and to prevent typos potentially crashing your machine, the recursion depth is capped at d=10. If you know what you are doing, you can use the –force option for higher values.

Recursion depth is limited to 5 to reduce server load and RAM usage. This implementation might not be very fast, it is just intended as a showcase of what you can expect from the CLI-version.

Needs python3 and the other three files to work.

For the cli-program see ag.py –help .

For a somewhat complete documentation of the source files run epydoc –html apollon.py ag.py coloring.py

For a writeup on how the math behind this program works see my blogpost here: http://lsandig.org/blog/2014/08/apollon-python/en/

  • More logical structure of the source files
  • Better documentation
  • A time- and RAM-saving algorithm that excludes Circles from recursion which are too small to be seen.
  • fastcgi version of index.cgi?

Colors from www.ColorBrewer.org by Cynthia A. Brewer, Geography, Pennsylvania State University.

Thanks to Dorothee Henke for helping me figuring out the math.

This software can be found on github: https://github.com/lsandig/apollon

This software is published under the GPL, see LICENSE

A blog for developers programming with Autodesk platforms, particularly AutoCAD and Forge. With a special focus on AR/VR and IoT.

  • Archives
  • Subscribe
  • Autodesk Blogs
  • Facebook Page
  • Google Plus
  • LinkedIn
  • Twitter

February 06, 2012

Circle packing in AutoCAD: creating an Apollonian gasket using .NET

To follow on from the recent series on using hyperbolic tessellation to generate patterns that might be used for 3D printing, I decided to research a slightly different approach.

While I found hyperbolic tessellation reasonably straightforward for generating 2D patterns, it was much harder to adapt to 3D, mainly because we’d need to create irregular polyhedra rather than just irregular 2D polygons. I had enough trouble getting my head around the 2D side of things that I decided not to go down that path for now, at least. The good news from Alex Fielder is that he’s been making good progress getting the hyperbolic tessellation code working inside Inventor (very cool), focusing – as far as I know – on using the 2D pattern to generate ribs rather than polyhedra (a very pragmatic approach).

I do think the type of pattern created through hyperbolic tessellation is probably more interesting from a structural perspective (having smaller versions at the edges with larger ones at the middle just makes a lot of sense), especially if working with polyhedra rather than ribs.

I expect to come back to something similar, in due course, but for now have been looking into a different approach: thinking about more regular (and therefore simpler) geometric forms by looking at circle packing before moving on to the very much related sphere packing.

There are a number of interesting strategies for circle packing: the one I like best is called the Apollonian gasket (which has been covered on a number of different Wikipedia pages, as well as on Wolfram MathWorld), which is also known as Leibniz packing. A related, specific case is that of Ford circles. The idea is that after creating three initial circles (each tangent to each other and to the outer circle), you draw the largest possible circle in the remaining space, continuing to sub-divide fractally as far as you’d like.

[As an aside… while researching this topic, I came across this interesting site by Takaya Iwamoto, a former colleague at Autodesk, who clearly shares my interest in fractals.]

And this of course also applies to 3D, although it may require a slightly different approach to get there.

I really like this pattern: while it may not create an internal structure optimised for strength, it should still be pretty interesting from a material savings perspective (short of having a completely hollow shell, of course). And I fully expect to looking into more structural filling techniques, further down the line.

The main problem to solve when generating the above pattern is to find a fourth mutually tangent circle (in 2D) or a fifth mutually tangent sphere (in 3D). It’s possible to use Descartes’ theorem in 2D or the Soddy-Gosset theorem in 3D (and beyond, for the truly fearless).

The example Find circles that are tangent to three given circles in Visual Basic .NET shows how to find up to eight circles that are tangent to three given circles. This example uses that method to build an Apollonian gasket.

(This is also called an Apollonian packing. If you think of each circle as cutting a hole in the enclosing circle so you get a lace-like figure, it’s a gasket. If you think of filling the enclosing circle with other circles, it’s a packing.)

The following FindApollonianPacking method controls the drawing and returns a Bitmap holding the packing.

This method starts by creating a bitmap of the desired size. It then creates the three largest circles inside the enclosing circle. It does a little math to size the circles appropriately, arranges them so they are tangent, and then draws them.

Next the code calls the FindApollonianCircle method used by the previous example to find a circle tangent to the three large circles. It passes the parameters -1, -1, and -1 to find the tangent circle that contains all three of the big circles so the result is the enclosing circle. The program draws the enclosing circle.

The code then calls the FindCircleOutsideAll method to find and draw the small circle that sits between the three initial circles. It finishes by calling FindCircleOutsideTwo three times to find the circles that lie inside the enclosing circle but outside of two of the inner big circles.

The following code shows the FindCircleOutsideAll method.

The FindCircleOutsideAll method finds a circle tangent to three other circles that does not contain any of the three. In this program that is the circle that lies between the three other circles. For example, the very center circle lies between the three large circles.

The code calls the FindApollonianCircle method used by the previous example program, passing it the parameters 1, 1, 1 to find the desired circle. If it finds such a circle, the code draws it.

The code then decrements the level parameter and if it is still greater than 0 the method calls itself recursively three times to find the circles between the new circle and the pairs of the original three circles. (Study the picture to see where those areas are.)

The following code shows the FindCircleOutsideTwo method.

This method finds a circle that is inside one circle and outside two others. For example, in the figure this method draws the medium-sized circle on the upper right that lies inside the enclosing circle and outside the two big circles.

The code calls the FindApollonianCircle method passing it the parameters 1, 1, and -1 to find the appropriate circle. Note that the order in which the code passes the circles to that method is important because the last circle is the one that should contain the new circle.

I have wanted for a while to use lacy tape and knit circles to make…well, actually I was stumped on application. When I described my swatch experiments on Twitter, Naomi Parkhurst dm-med a sketch of how I could make a crescent shawl with them, and I tucked that into my mental file of things I really wanted to figure out but thought might be hard.

In the mean time, my oldest son finished his college degree, and since he has studied a whole lot more mathematics than I have, I asked him what to investigate.

Apollonian Gaskets he said. Oh. Wow.

So, I need to figure out, what the size of the shawl should be, and can you take an Apollonian Gasket, spread it out and put lacy tape leading between the circles, or should the whole thing be held together with smaller and smaller circles? Will I finally be designing with color (one strand at a time of course, I’m that lazy) and will it sell?

2 Replies to “Links for Apollonian Gasket”

Oh that would be SO cool! Great job on the investigation, eldest son :-). I wonder if you made it a rectangular shawl with a negative space border kinda like what would happen if it were crocheted rather than knit

I agree! I’m wondering if the circles are only connected at the tangent points if the fabric would be floppy, or if it would be fine…

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

The classical Descartes-Soddy relationship between the signed curvatures $b_k$ (“b” for “bend”) of 4 mutually tangent circles (Apollonian configuration):

$$\sum_^4 b_k^2=\tfrac12 \left(\sum_^4 b_k\right)^2\tag<1>$$

allows to obtain the curvature $b_4$ , knowing $b_1,b_2,b_3$ by considering (1) as a quadratic equation in variable $b_4$ . The fact that there are two solutions $b_4$ and $b’_4$ is in harmony with our experience. On fig. 1 below are represented 3 given mutually tangent circles in blue, and interior and exterior tangent circles to them in red).

How to create an apollonian gasket

From there, one obtains the radii $r_4=\tfrac<1><|b_4|>$ and $r’_4=\tfrac<1><|b'_4|>.$

But the centers $z_4$ and $z’_4$ (we work with complex notations) of the fourth circles are usually computed in a separate way.

In fact, the following unexpected formula (obtained only some 20 years ago) gives an easy way to obtain as well the centers of these circles:

$$\sum_^4 (b_kz_k)^2=\tfrac12 \left(\sum_^4 b_kz_k\right)^2\tag<2>$$

(please note the beautiful similarity with (1)!). One can find a proof of (2) with nD extensions by its discoverers in this well written document : https://arxiv.org/pdf/math/0101066.pdf

As before for relationship (1), $z_4$ is computed by considering (2) as a quadratic equation, this time with variable $z_4$ (or $b_4z_4$ ) giving the two centers $z_4$ and $z’_4$ (assuming that $b_4$ and $b’_4$ have been computed beforehand). See paragraph “complex Descartes theorem” in (https://en.wikipedia.org/wiki/Descartes%27_theorem).

Using formulas (1) et (2), I am able to make a certain number of steps by iterating initial step (figure 1); here is for example a second step where 6 new circles have been added to figure 1:

How to create an apollonian gasket

In the upsaid arxiv document, one finds in particular this figure :

How to create an apollonian gasket

Fig. 3 : A so-called “Apollonian gasket”.

where the numbers figuring inside the disks are their unsigned curvatures.

I would like to “programmaticaly” reproduce this figure or similar figures but I am facing the difficulty to understand/manage its underlying recursive structure. Has somebody a hint ?

And these two from the same site:

Remark 1 : The authors of the text mentionned at the beginning have published it in American Mathematical Monthly one year later: Jeffrey C. Lagarias, Colin L. Mallows, and Allan R. Wilks, Beyond the Descartes circle theorem, Amer. Math. Monthly 109 (2002), no. 4, 338–361.

Remark 2 : The term “Circles of Apollonius” may be misleading ; there are other circles having this name as explained here.

Remark 3: There are strong connections with Farey sequences (see in particular the last figure of this article).

We modify the Apollonian gasket presented in the earlier post Apollonian gasket as a spherical fractal with tetrahedral symmetry. In an icosahedron, five triangles meet at their corners, which gives us a fivefold rotational symmetry. At the centers of the triangles we have a threefold rotational symmetry and at the middle of their edges a twofold one. The corresponding kaleidoscopic triangle thus has corner angles of 36, 60 and 9’0 degrees. Their sum is 186 degrees, just enough to make the triangle elliptic. Multiple reflection at the sides of this triangle makes a stereographic projection of a sphere with an icosahedral tiling :

How to create an apollonian gasket

Spherical tiling with icosahedral symmetry generated by reflections at the blue lines and circle shown in stereographic projection. The dashed line marks the projection of the equator.

Adding an inverting circle we get a fractal. It is a decoration of the icosahedral tiling :

How to create an apollonian gasket

Icosahedral fractal, shown in black, resulting from reflection at two lines and two circles. It decorates the icosahedral tiling, which is shown in yellow. This is a stereographic projection.

The icosahedral symmetry becomes evident using an inverse stereographic projection to a sphere. The normal projections of the upper and lower hemispheres are the same, except for a rotation by 36 degrees. This is a view of the lower hemisphere :

How to create an apollonian gasket

Normal view of a hemisphere with an icosahedral tiling (yellow) decorated by a variant of the Apollonian gasket (black).

Drawing both hemispheres of the gasket together we get :

How to create an apollonian gasket

Superposition of both hemispheres of a variant of the Apollonian gasket with icosahedral symmetry.

You can see how they nicely fit together.

The stars of five-fold rotational symmetry contain small copies of themselves. This results from a recursive packing of discs, quite similar to the Apollonian gasket. But now it is based on ideal pentagons instead of triangles:

How to create an apollonian gasket

The five discs, shown in green, leave a gap in the shape of a pentagon. Putting fifteen discs, which are coloured blue, in this gap we get eleven gaps. They are again pentagons and are filled in the same way.

My son and I were recently watching Vi Hart’s wonderful “Doodling in Math Class” Video on Infinity Elephants. Around 1:30 in the video she starts talking about how to draw an Apollonian Gasket in a triangle:

How to create an apollonian gasket

This got me wondering about how to code this object. It’s not a new challenge. Lot’s of people have done it. You can even search Shapeways to find some amazing 3-D printed, 3-dimensional versions. But I couldn’t find much info on how its done. I did find an old discussion here where they were wondering how to do the same thing. (Nothing really useful there, except some nice references to hyperbolic Geometry-specifically a little paper by David Dumas-with a dead link to a program written by Curt McMullen.)

I’ll use Python when I have to, but my preferred method of construction is with the visual programming language Grasshopper, a plug-in for the CAD program Rhinoceros3D. Clearly, the object I was trying to replicate is fractal, which means recursion is going to be unavoidable. That’s easy enough in Python, but it sucks in Grasshopper. The only way I know to do recursion in Grasshopper is with a 3rd party component. I think there are multiple options. The one I use is called “Hoopsnake.” It does the job, but for this kind of thing it’s extremely slooowwww. That’s OK, because to replicate the drawing in Vi’s video, I’m only going to do about 5 iterations.

It took a bit of experimenting, but eventually I got it down to a surprisingly small Grasshopper definition. The key was to use the CircleTanTanTan component, which automatically finds the circle that is tangent to three different input curves. For the Grasshopper savvy out there, here’s my definition:

How to create an apollonian gasket

Here’s what it produces….

How to create an apollonian gasket

…exactly what I wanted!!

How to create an apollonian gasket

Once I had that, it wasn’t hard to make all kinds of designs. Here are some Apollonian Spheres.

I even experimented with an Apollonian Pocket Watch Design!

Representation for circles that lets us quickly compute an Apollonian gasket.

The bend is the reciprocal of signed radius: a negative radius means the outside and inside of the circle are switched. The bends of any four mutually tangent circles satisfy Descartes’ Theorem.

Product of bend and center represented as a complex number. Amazingly, these products also satisfy the equation of Descartes’ Theorem.

The Num , Fractional , and Floating instances for Circle (all simply lifted elementwise over Circle ‘s fields) let us use Descartes’ Theorem directly on circles.

Create a Circle given a signed radius and a location for its center.

Get the center of a circle.

Get the (unsigned) radius of a circle.

Descartes’ Theorem states that if b1 , b2 , b3 and b4 are the bends of four mutually tangent circles, then

Surprisingly, if we replace each of the bi with the product of bi and the center of the corresponding circle (represented as a complex number), the equation continues to hold! (See the paper referenced at the top of the module.)

descartes [b1,b2,b3] solves for b4 , returning both solutions. Notably, descartes works for any instance of Floating , which includes both Double (for bends), Complex Double (for bend/center product), and Circle (for both at once).

If we have four mutually tangent circles we can choose one of them to replace; the remaining three determine exactly one other circle which is mutually tangent. However, in this situation there is no need to apply descartes again, since the two solutions b4 and b4′ satisfy

Hence, to replace b4 with its dual, we need only sum the other three, multiply by two, and subtract b4 . Again, this works for bends as well as bend/center products.

Generate an initial configuration of four mutually tangent circles, given just the signed bends of three of them.

Given a threshold radius and a list of four mutually tangent circles, generate the Apollonian gasket containing those circles. Stop the recursion when encountering a circle with an (unsigned) radius smaller than the threshold.

Kissing sets

The basic idea of a kissing set is supposed to represent a set of four mutually tangent circles with one selected, though in fact it is more general than that: it represents any set of objects with one distinguished object selected.

Generate all possible kissing sets from a set of objects by selecting each object in turn.

“Flip” the selected circle to the other circle mutually tangent to the other three. The new circle remains selected.

Make the selected circle unselected, and select each of the others, generating a new kissing set for each.

Apollonian trees

Given a set of four mutually tangent circles, generate the infinite Apollonian tree rooted at the given set, represented as a list of four subtrees. Each node in the tree is a kissing set with one circle selected which has just been flipped. The three children of a node represent the kissing sets obtained by selecting each of the other three circles and flipping them. The initial roots of the four trees are chosen by selecting and flipping each of the circles in the starting set. This representation has the property that each circle in the Apollonian gasket is the selected circle in exactly one node (except that the initial four circles never appear as the selected circle in any node).

Generate a single Apollonian tree from a root kissing set. See the documentation for apollonianTrees for an explanation.

The example Find circles that are tangent to three given circles in Visual Basic 6 shows how to find up to eight circles that are tangent to three given circles. This example uses that method to build an Apollonian gasket.

(This is also called an Apollonian packing. If you think of each circle as cutting a hole in the enclosing circle so you get a lace-like figure, it’s a gasket. If you think of filling the enclosing circle with other circles, it’s a packing.)

The following FindApollonianPacking method controls the drawing and returns a Bitmap holding the packing.

This method starts by creating the three largest circles inside the enclosing circle. It does a little math to size the circles appropriately, arranges them so they are tangent, and then draws them.

Next the code calls the FindApollonianCircle method used by the previous example to find a circle tangent to the three large circles. It passes the parameters -1, -1, and -1 to find the tangent circle that contains all three of the big circles so the result is the enclosing circle. The program draws the enclosing circle.

The code then calls the FindCircleOutsideAll method to find and draw the small circle that sits between the three initial circles. It finishes by calling FindCircleOutsideTwo three times to find the circles that lie inside the enclosing circle but outside of two of the inner big circles.

The following code shows the FindCircleOutsideAll method.

The FindCircleOutsideAll method finds a circle tangent to three other circles that does not contain any of the three. In this program that is the circle that lies between the three other circles. For example, the very center circle lies between the three large circles.

The code calls the FindApollonianCircle method used by the previous example program, passing it the parameters 1, 1, 1 to find the desired circle. If it finds such a circle, the code draws it.

The code then decrements the level parameter and if it is still greater than 0 the method calls itself recursively three times to find the circles between the new circle and the pairs of the original three circles. (Study the picture to see where those areas are.)

The following code shows the FindCircleOutsideTwo method.

This method finds a circle that is inside one circle and outside two others. For example, in the figure this method draws the medium-sized circle on the upper right that lies inside the enclosing circle and outside the two big circles.

The code calls the FindApollonianCircle method passing it the parameters 1, 1, and -1 to find the appropriate circle. Note that the order in which the code passes the circles to that method is important because the last circle is the one that should contain the new circle.

Author: Mitch Richling
Updated: 2021-05-22

How to create an apollonian gasket

Table of Contents

  • 1. Apollonian Gaskets
  • 2. Generating Circles and Spheres
  • 3. Rendering
  • 4. An IFS Approach
  • 5. References

1 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:

How to create an apollonian gasket How to create an apollonian gasket

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:

How to create an apollonian gasket How to create an apollonian gasket How to create an apollonian gasket

2 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:

3 Rendering

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 POV-Ray with the following thre input files:

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, see the makefile:

4 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).

We can generate an image with a bit of code – C++ this time:

It draws the central region of Apollonian Gasket fractal using IFS description.

Created by FB36 on Sat, 14 Jan 2012 (MIT)
Python recipes (4591)
FB36’s recipes (148)
  • fractal
  • math
  • mathematics

▶ Show machine tags (5)

  • meta:language=python
  • meta:license=mit
  • meta:loc=29
  • meta:requires=pil
  • meta:score=1

Required Modules

Other Information and Tasks

  • Licensed under the MIT License
  • Viewed 5733 times
  • Revision 1

Accounts

  • Create Account (Free!)
  • Sign In

Code Recipes

  • Recipes
  • Languages
  • Tags
  • Authors
  • Sets

Feedback & Information

  • About
  • FAQ
  • Terms of Service

ActiveState

  • ActiveState Blog
  • Perl Solutions
  • Python Solutions
  • Tcl Solutions
  • Download ActivePerl
  • Download ActivePython
  • Download ActiveTcl
  • About ActiveState
  • Careers

© 2022 ActiveState Software Inc. All rights reserved. ActiveState®, Komodo®, ActiveState Perl Dev Kit®, ActiveState Tcl Dev Kit®, ActivePerl®, ActivePython®, and ActiveTcl® are registered trademarks of ActiveState. All other marks are property of their respective owners.

Inkscape extension to make Apollonian gaskets. Ported as Fork to make it compatible with InkScape 1.0+

An Apollonian gasket can be constructed as follows. Start with three circles C1, C2 and C3, each one of which is tangent to the other two (in the general construction, these three circles can be any size, as long as they have common tangents). Apollonius discovered that there are two other non-intersecting circles, C4 and C5, which have the property that they are tangent to all three of the original circles – these are called Apollonian circles. Adding the two Apollonian circles to the original three, we now have five circles.

Take one of the two Apollonian circles – say C4. It is tangent to C1 and C2, so the triplet of circles C4, C1 and C2 has its own two Apollonian circles. We already know one of these – it is C3 – but the other is a new circle C6. In a similar way we can construct another new circle C7 that is tangent to C4, C2 and C3, and another circle C8 from C4, C3 and C1. This gives us 3 new circles. We can construct another three new circles from C5, giving six new circles altogether. Together with the circles C1 to C5, this gives a total of 11 circles.

Continuing the construction stage by stage in this way ad infinituum one obtains a set of circles which is an Apollonian gasket.

###Example Inkscape file

  1. Edit the first line of apollon_inx.py to point to your python installation if you don’t use Anaconda on OSX.
  2. Copy the .inx and all the .py to inkscape extensions folder : For OS X – $HOME/.config/inkscape/extensions
  3. Open Inkscape.
  4. Activate via the Render submenu of Extensions menu.

Needs Anaconda python on OS X but should work with any python 2.7* installation after modifying as per installation instructions.

Foam consists of bubbles packed together in a fractal pattern.

Let’s use what we have learned about fractals to study a real-world phenomenon: foam. By definition a foam is any material made up of bubbles packed closely together. If the bubbles tend to be very large, you might call it a froth.

We know that bubbles like to form spheres, because the sphere is the most efficient shape for minimizing surface area around a fixed volume. When you blow a soap bubble on a warm spring day, for example, that bubble will be approximately spherical until it pops.

However, spheres do not pack together very nicely. There’s always gaps between the adjacent spheres. So when a foam forms, there may be some number of large bubbles, interspersed with smaller bubbles in the gaps, which in turn have even smaller bubbles in their gaps and so on. The foam is approximately self-similar on smaller and smaller scales; in other words, foam is fractal.

Let’s take a look at a two-dimensional idealized version of foam called the Apollonian gasket. This figure is created by the following procedure. It helps to have a compass handy.

  1. Draw a large circle.
  2. Within the circle, draw three smaller circles that all touch one another. In technical terms, we say that the circles are mutually tangent to one another.
  3. In the gaps between these circles, draw smaller circles that are as large as possible without overlapping any existing circles. If you do this correctly, the new circle will be tangent to two of the circles from step 2 as well as the original big circle.
  4. Continue in this way, filling each new gap with as large a circle that will fit without overlap. Notice that with each new circle, there will be multiple new gaps to fill.

The process should continue indefinitely, however you will eventually reach a stage in which the gaps are smaller than the width of your pencil or pen. At that point, you can step back and admire your work. A computer-generated Apollonian gasket is shown in the figure below.

The Apollonian gasket is a fractal that can be used to model soap bubble foam.

Because the Apollonian gasket is only approximately self-similar, there is not a well-defined scaling-dimension. However, if you look at any “triangular” section within three circles, it looks like a curved version of the Sierpinski gasket. Recall, it requires 3 copies of the Sierpinski gasket in order to scale it by a factor of 2. So we would expect the fractal dimension of the Apollonian gasket to be close to:

In fact, using a more general definition of fractal dimension, it can be shown that the dimension of the Apollonian gasket is about 1.3057. This implies that the gasket is somehow closer to being one-dimensional than two-dimensional. In turn, a foam made of large bubbles, like the froth on top of your latte is more two-dimensional than three-dimensional. Remember this next time you get an extremely frothy drink; there’s very little substance to it!

The Apollonian Gasket Orbit Trap examples are based on an Orbit Trap called the Apollonian Gasket . The Apollonian Gasket is a stand-alone fractal. It is implemented as an Orbit Trap so it can take advantage of Orbit Trap related features in the Fractal Science Kit, but it does not need the normal orbit processing; i.e., I set the Max Dwell property found in the Orbit Trap Orbit Generation section on the Mandelbrot / Julia / Newton page, to 1, eliminating the normal orbit processing.

For these examples I modified the built-in Orbit Trap Apollonian Gasket to add the 2 silver border circles seen in the images.

The examples use complex Transformations to alter the fractal, and color the trap using a set of Perlin Noise based Orbit Trap Controllers to achieve the stone-like appearance. You can create lots of variations by changing the transformation applied to the fractal.

The Apollonian Gasket Orbit Trap examples were inspired by information found on the Fractal Geometry site. Additional information can be found in the excellent book Indra’s Pearls – The Vision of Felix Klein by David Mumford, Caroline Series, and David Wright.

Performance

The Apollonian Gasket Orbit Trap examples are based on an Orbit Trap called Apollonian Gasket . There are a few properties associated with the trap that are related to quality and also affect performance. When you are exploring, you can improve performance by adjusting these properties on the trap’s properties page.

Open the orbit trap’s properties page:

Depth , Radius Cutoff , and Min Radius , control the number of circles that are generated to define the fractal. Depth is the depth of recursion used in the algorithm. Radius Cutoff is the minimum radius of circles placed on the processing stack and is used to terminate the recursion loop early on selected branches. Min Radius is the minimum radius required for a circle to be displayed.

You can increase Depth and/or decrease Radius Cutoff or Min Radius to fill in the gaps between circles but these changes can cause dramatic increases in processing time. If you make a change that seems to be taking forever, you should click the Cancel Display command on the Tools menu of the Fractal Window to terminate the processing. Then try adjusting these properties to reduce the processing (i.e., decrease Depth and/or increase Radius Cutoff or Min Radius ).

When you are exploring, you should set Depth to 32 , Radius Cutoff to 0.004 , and Min Radius to 0.004 . This will greatly improve performance at the expense of quality. You can reset them later when you find an image you wish to save.

Zoom In/Out

Zoom In or Zoom Out to examine different parts of the fractal.

Execute the Home command on the View menu of the Fractal Window to reset the fractal to the default position/magnification, and then Zoom In to other areas.

Change the Transformation

You can apply a transformation to the fractal.

Execute the Home command on the View menu of the Fractal Window to reset the fractal to the default position/magnification before you adjust the transformation. Then change the transformation and Zoom In to interesting areas of the transformed image.

With the exception of Apollonian Gasket Orbit Trap 01 , each of these examples applies a transformation to the fractal.

  • Apollonian Gasket Orbit Trap 02 applies the transformation Kaleidoscope – Triangles .
  • Apollonian Gasket Orbit Trap 03 applies the transformation Composite Function .
  • Apollonian Gasket Orbit Trap 04 applies the transformation Composite Function .
  • Apollonian Gasket Orbit Trap 05 applies 2 transformations: Kaleidoscope – Triangles and Composite Function .

In the following, when I refer to the transformation, I will use Composite Function , but you should use the transformation for the example you are working with.

To change the transformation applied to the fractal, select the transformation’s properties page:

Set the F(z) property to one of the complex functions in the list. You can change some of the other properties on this page for more variations.

You can also use a different transformation altogether. Select the Composite Function page, and change the Based On property to select a transformation and then open the transformation’s properties page (found under the transformation in the page hierarchy), and play with the transformation’s properties. See Transformation Support for details.

To add additional transformations, select Transformation:

Click the New toolbar button to add a new Identity transformation to the bottom of the list, and then click the Move Up toolbar button to move the new transformation to the desired position in the list. Normally, I move the new transformation to the top of the list, but it can be placed anywhere. See Transformation Array for details.

Then select the Identity transformation:

Change the Based On property to select a transformation and then open the transformation’s properties page (found under the transformation in the page hierarchy), and play with the transformation’s properties. See Transformation Support for details.

Xin Zhang, Statistical Regularity of Apollonian Gaskets, International Mathematics Research Notices, Volume 2021, Issue 2, January 2021, Pages 1055–1095, https://doi.org/10.1093/imrn/rnz241

Abstract

Apollonian gaskets are formed by repeatedly filling the gaps between three mutually tangent circles with further tangent circles. In this paper we give explicit formulas for the limiting pair correlation and the limiting nearest neighbor spacing of centers of circles from a fixed Apollonian gasket. These are corollaries of the convergence of moments that we prove. The input from ergodic theory is an extension of Mohammadi–Oh’s theorem on the equidisribution of expanding horospheres in the frame fundles of infinite volume hyperbolic spaces.

Sign in

Personal account

  • Get email alerts
  • Save searches
  • Purchase content
  • Activate purchases and trials

Institutional access

  1. Sign in through your institution
  2. Sign in with username / password

Institutional account management

Get help with access

Institutional access

Access to restricted content on Oxford Academic is often provided through institutional subscriptions and purchases. If you are a member of an institution with an active account, you may be able to access content in the following ways:

IP based access

Typically, access is provided across an institutional network to a range of IP addresses. This authentication occurs automatically, and it is not possible to sign out of an IP authenticated account.

Sign in through your institution

Choose this option to get remote access when outside your institution.

Shibboleth / Open Athens technology is used to provide single sign-on between your institution’s website and Oxford Academic.

  1. Click Sign in through your institution.
  2. Select your institution from the list provided, which will take you to your institution’s website to sign in.
  3. When on the institution site, please use the credentials provided by your institution. Do not use an Oxford Academic personal account.
  4. Following successful sign in, you will be returned to Oxford Academic.

If your institution is not listed or you cannot sign in to your institution’s website, please contact your librarian or administrator.

Sign in with a library card

Enter your library card number to sign in. If you cannot sign in, please contact your librarian.

Society Members

Many societies offer member access to their journals using single sign-on between the society website and Oxford Academic. From the journal on Oxford Academic:

  1. Click Sign in through society site.
  2. When on the society site, please use the credentials provided by that society. Do not use an Oxford Academic personal account.
  3. Following successful sign in, you will be returned to Oxford Academic.

If you do not have a society account or have forgotten your username or password, please contact your society.

Some societies use Oxford Academic personal accounts for their members.

Personal account

A personal account can be used to get email alerts, save searches, purchase content, and activate subscriptions.

Some societies use Oxford Academic personal accounts to provide access for their members.

Institutional administration

For librarians and administrators, your personal account also provides access to institutional account management. Here you will find options to view and activate subscriptions, manage institutional settings and access options, access usage statistics, and more.

Viewing your signed in accounts

You can be signed in to your personal account and your institution’s account at the same time. Click the account icon in the top left to view your signed in accounts and access account management features.

Signed in but can’t access content

Oxford Academic is home to a wide variety of products. The institutional subscription may not cover the content that you are trying to access. If you believe you should have access to that content, please contact your librarian.

Purchase

Short-term Access

To purchase short term access, please sign in to your Oxford Academic account above.

Don’t already have an Oxford Academic account? Register

The Apollonian Gasket examples are based on a custom symmetry transformation applied to a variation of the Apollonian Gasket.

The Apollonian Gasket , and the methods used to produce them, are described in the excellent book Indra’s Pearls – The Vision of Felix Klein by David Mumford, Caroline Series, and David Wright. For additional details, see David Wright’s Indra’s Pearls site.

Change the Transformation

You can apply a transformation to the fractal. Use the transformation named Transformation 2 which is applied after the symmetry transformation.

Execute the Home command on the View menu of the Fractal Window to reset the fractal to the default position/magnification before you adjust the transformation. Then change the transformation and Zoom In to interesting areas of the transformed image.

To apply a transformation to the fractal, select the Identity transformation:

Set the Based On property to one of the available transformations, select the transformation’s properties page (found under the transformation in the page hierarchy), and play with the properties found there.

Mobius transformations work especially well in these examples because they preserve circles; i.e., circles are mapped to circles.

To use a Mobius transformation, set the Based On property to one of the following transformations:

  • Mobius Transformation
  • Mobius Transformation – Elliptic
  • Mobius Transformation – Hyperbolic
  • Mobius Transformation – Loxodromic
  • Mobius Transformation – Parabolic
  • Disc Automorphism – Elliptic
  • Disc Automorphism – Hyperbolic
  • Disc Automorphism – Parabolic
  • Disc Automorphism – General
  • Half-Plane to Disk
  • Circle To Circle
  • Poincare Disk
  • Mobius Group

Note that the default for most of these transformations is the identity transformation (which does nothing) so you will need to select the properties page found under the transformation and change the properties in the section labeled Transformation Control .

Change the Variation

Skip this section if you are not comfortable with the geometry of the complex plane.

In these examples, the Orbital Equation generates a variation of the Apollonian Gasket. A custom Symmetry Transformation is used to overlay several transformed copies of the base fractal resulting in the images you see here. You can generate lots of images like these using this technique, but you need to coordinate the Symmetry Transformation with the variation of the Apollonian Gasket that you select, for the best results.

For example, Apollonian Gasket 01 is based on the classic Apollonian Gasket which has 2 empty circular areas that are 0.5 the size of the base fractal, with centers at 0.5 and -0.5 . In addition, there are 2 empty circular areas that are 0.33333 the size of the base fractal, with centers at 0.66666i and -0.66666i . The symmetry transformation used in Apollonian Gasket 01 defines 4 transformations that scale/translate the original Apollonian Gasket into these 4 empty circular areas and a 5 th transformation that inverts the Apollonian Gasket in a circle centered at the origin with radius 1.

If you want to see the variation of the Apollonian Gasket without the effect of the symmetry transformation, set the Count property to 0 on the symmetry transformation’s properties page:

General
Orbital / IFS / Strange Attractor
Symmetry Transformation: Transformation Set – General
Properties

The other examples use different variations of the Apollonian Gasket and define symmetry transformations based on the geometry of each variation.

To generate additional images, start with one of the variations of the Apollonian Gasket and construct the symmetry transformation by filling in the empty parts of the base image with scaled copies of the base fractal.

The properties for the Apollonian Gasket are found at:

General
Orbital / IFS / Strange Attractor
Orbital Equation: Apollonian Gasket (Variations)
Properties

Change the Variation property to view the different variations.

The properties for the symmetry transformation are found at:

General
Orbital / IFS / Strange Attractor
Symmetry Transformation: Transformation Set – General
Properties
Transformations

The Properties page has a few general properties and the Transformations page is used to define the set of transformations.

The Apollonian Gasket Variations examples use an attractor based on a variation of the algorithm used to generate the Apollonian Gasket .

The Apollonian Gasket , and the methods used to produce them, are described in the excellent book Indra’s Pearls – The Vision of Felix Klein by David Mumford, Caroline Series, and David Wright. For additional details, see David Wright’s Indra’s Pearls site.

Change the Variation

You can change the variation.

Select the equation’s properties page:

General
Orbital / IFS / Strange Attractor
Orbital Equation: Apollonian Gasket (Variations)
Properties

Change the Variation property to one of the predefined variations or create your own by defining a Mobius transformation.

Change the Invert property to conjugate the results with the complex inversion transformation.

I do not recommend changing the Mobius transformations defined for Attractor 1 or Attractor 2 unless you understand the algorithm on which this attractor is based.

Change the Transformation

You can apply a transformation to the fractal.

Execute the Home command on the View menu of the Fractal Window to reset the fractal to the default position/magnification before you adjust the transformation. Then change the transformation and Zoom In to interesting areas of the transformed image.

Note the following:

  • Apollonian Gasket Variations 01 applies the Identity transformation to the fractal.
  • Apollonian Gasket Variations 02 applies the transformation Disc Automorphism – Hyperbolic to the fractal.
  • Apollonian Gasket Variations 03 applies the Identity transformation to the fractal.
  • Apollonian Gasket Variations 04 applies the transformation Clip to the fractal.

The Identity transformation does not alter the image.

In the remaining sections, when I refer to the transformation, I will use Identity , but you should use the transformation for the example you are working with.

To apply a transformation to the fractal, select the Identity transformation’s page:

Set the Based On property to one of the available transformations, select the transformation’s properties page (found under the transformation in the page hierarchy), and play with the properties found there.

Mobius transformations work especially well in these examples because they preserve circles; i.e., circles are mapped to circles.

To use a Mobius transformation, set the Based On property to one of the following transformations:

  • Mobius Transformation
  • Mobius Transformation – Elliptic
  • Mobius Transformation – Hyperbolic
  • Mobius Transformation – Loxodromic
  • Mobius Transformation – Parabolic
  • Disc Automorphism – Elliptic
  • Disc Automorphism – Hyperbolic
  • Disc Automorphism – Parabolic
  • Disc Automorphism – General
  • Half-Plane to Disk
  • Circle To Circle
  • Poincare Disk
  • Mobius Group

Note that the default for most of these transformations is the identity transformation (which does nothing) so you will need to select the properties page found under the transformation and change the properties in the section labeled Transformation Control .

To add additional transformations, select Transformation 1:

Click the New toolbar button to add a new Identity transformation to the bottom of the list. See Transformation Array for details.

Then select the Identity transformation:

Change the Based On property to select a transformation and then open the transformation’s properties page (found under the transformation in the page hierarchy), and play with the transformation’s properties. See Transformation Support for details.

wikiHow is ‘n ‘wiki’, soortgelyk aan Wikipedia, wat beteken dat baie van ons artikels saam geskryf is deur verskeie outeurs. Om hierdie artikel te skep, het 15 mense, sommige anoniem, gewerk om dit mettertyd te wysig en te verbeter.

Hierdie artikel is 42 725 keer gekyk.

‘N Apolloniese pakking is ‘n soort fraktale beeld wat gevorm word uit ‘n versameling van steeds krimpende sirkels wat binne ‘n enkele groot sirkel voorkom. Elke sirkel in die Apolloniese pakking is raaklyn aan die aangrensende sirkels – met ander woorde, die sirkels in die Apolloniese pakking maak kontak op oneindige klein punte. Hierdie soort fraktale, wat vernoem is na die Griekse wiskundige Apollonius van Perga, kan tot ‘n redelike mate van ingewikkeldheid (met die hand of per rekenaar) geteken word en ‘n pragtige, opvallende beeld vorm. Raadpleeg stap 1 hieronder om aan die gang te kom.

Om duidelik te wees , is dit nie noodsaaklik om die wiskundebeginsels agter die fraktaal te ondersoek as u bloot belangstel om ‘ n Apollonian Gasket te teken nie. As u egter ‘n dieper begrip van Apollonian Pakkings wil hê, is dit belangrik om die definisies van verskillende begrippe te verstaan ​​wat ons sal gebruik as u dit bespreek.

How to create an apollonian gasket

How to create an apollonian gasket

Apolloniese pakkings het die vorm van pragtige fraktale rangskikkings van krimpende sirkels. Wiskundig het Apollonian Pakkings oneindige kompleksiteit, maar of u nou ‘n rekenaartekenprogram of tradisionele tekeninstrumente gebruik, u sal uiteindelik ‘n punt bereik waarop dit onmoontlik is om sirkels kleiner te trek. Hoe meer presies u sirkels teken, hoe meer in u pakking kan pas.

Representation for circles that lets us quickly compute an Apollonian gasket.

The bend is the reciprocal of signed radius: a negative radius means the outside and inside of the circle are switched. The bends of any four mutually tangent circles satisfy Descartes’ Theorem.

Product of bend and center represented as a complex number. Amazingly, these products also satisfy the equation of Descartes’ Theorem.

The Num , Fractional , and Floating instances for Circle (all simply lifted elementwise over Circle ‘s fields) let us use Descartes’ Theorem directly on circles.

Create a Circle given a signed radius and a location for its center.

Get the center of a circle.

Get the (unsigned) radius of a circle.

Descartes’ Theorem states that if b1 , b2 , b3 and b4 are the bends of four mutually tangent circles, then

Surprisingly, if we replace each of the bi with the product of bi and the center of the corresponding circle (represented as a complex number), the equation continues to hold! (See the paper referenced at the top of the module.)

descartes [b1,b2,b3] solves for b4 , returning both solutions. Notably, descartes works for any instance of Floating , which includes both Double (for bends), Complex Double (for bend/center product), and Circle (for both at once).

If we have four mutually tangent circles we can choose one of them to replace; the remaining three determine exactly one other circle which is mutually tangent. However, in this situation there is no need to apply descartes again, since the two solutions b4 and b4′ satisfy

Hence, to replace b4 with its dual, we need only sum the other three, multiply by two, and subtract b4 . Again, this works for bends as well as bend/center products.

Generate an initial configuration of four mutually tangent circles, given just the signed bends of three of them.

Given a threshold radius and a list of four mutually tangent circles, generate the Apollonian gasket containing those circles. Stop the recursion when encountering a circle with an (unsigned) radius smaller than the threshold.

Contents

  • 1 Theory
  • 2 How to compute and draw Apollonian gasket ?
    • 2.1 Notation
    • 2.2 Algorithms
      • 2.2.1 Mandelbrot algorithm
      • 2.2.2 Soddy’s algorithm
        • 2.2.2.1 Functions
          • 2.2.2.1.1 Functions for computing curvature and center
          • 2.2.2.1.2 Functions for computing ck list
          • 2.2.2.1.3 Functions for filling gaps
        • 2.2.2.2 Construction
        • 2.2.2.3 Algorithm for programmers
        • 2.2.2.4 Relation betwen circles
        • 2.2.2.5 Number of circles
        • 2.2.2.6 Curvatures
        • 2.2.2.7 Example programs
          • 2.2.2.7.1 Haskell and EDSL Diagrams
          • 2.2.2.7.2 Java
          • 2.2.2.7.3 Maxima CAS
          • 2.2.2.7.4 Common Lisp
          • 2.2.2.7.5 JavaScript
  • 3 See also
  • 4 References
  • wikipedia [1]
  • mathforum : Problem of Apollonius [2]

Notation Edit

  • Apollonian gasket = curvilinear Sierpinski gasket = Leibniz packing = Apollonian packing
  • stage = level = step
  • incircle = inscribed circle = circle inside 3 circles = inner circle
  • gap = curvilinear triangle = ideal triangle ( because the sides are tangent at each vertix and the angle between them is zero) = region between 3 tangent circles

Algorithms Edit

Apollonian gasket can be made using these algorithms: [3]

  • Mandelbrot algorithm [4] ( using circle inversion) [5][6]
  • Soddy’s algorithm ( using circle Descartes theorem ) [7][8]
  • IFS algorithm by Alexei Kravchenko and Dmitriy Mekhontsev [9]

All algorithms give state after n stages. It is an aproximation of limit set which is made of infinite number of stages (cicles).

Mandelbrot algorithm Edit

Soddy’s algorithm Edit

It will be explained by example gasket with initial configuration : 3 inner circles with integer curvatures

This algorithm uses:

When center of outer circle is at origin one has to chose solutions in case of centers. It is easier when the all gasket is in the first quadrant of Cartesian plane. Then all centers have positive parts ( real and imaginary ).

Functions Edit

Functions for computing curvature and center Edit
Functions for computing ck list Edit

Now one can define new functions ( Maxima CAS code) for computing 4-th circle mutually tangent to 3 given circles:

Functions for filling gaps Edit

Construction Edit

  • initial stage : 3 mutually tangent circles = ( k i a , k i b , k i c ) <\displaystyle (k_,k_,k_)>
  • zero stage : 2 circles tangent to previous : outer circle c k 0 o u t <\displaystyle ck_<0out>> and inner circle c k 0 i n <\displaystyle ck_<0in>> , where :

c k 0 o u t = f m m ( c k i a , c k i b , c k i c ) <\displaystyle <\color ck>_<0out>=f_<\color mm>(ck_,ck_,ck_)> c k 0 i n = f p p ( c k i a , c k i b , c k i c ) <\displaystyle ck_<0in>=f_(ck_,ck_,ck_)>

  • first stage : there are 6 gaps ( = curvilinear triangles) between previous circles. Three gaps are peripheral ( near outer circle) and three are medial ( near inner circle). Put one circle in each gap :

c k 1 a = f p p ( c k i a , c k i b , c k 0 o u t ) <\displaystyle ck_<1a>=f_(ck_,ck_,ck_<0out>)> c k 1 b = f p p ( c k i b , c k i c , c k 0 o u t ) <\displaystyle ck_<1b>=f_(ck_,ck_,ck_<0out>)> c k 1 c = f p m ( c k i c , c k i a , c k 0 o u t ) <\displaystyle <\color c>k_<1c>=f_m>>(ck_,ck_,ck_<0out>)> c k 1 d = f p p ( c k i a , c k i b , c k 0 i n ) <\displaystyle ck_<1d>=f_(ck_,ck_,ck_<0in>)> c k 1 e = f p p ( c k i b , c k i c , c k 0 i n ) <\displaystyle ck_<1e>=f_(ck_,ck_,ck_<0in>)> c k 1 f = f p p ( c k i c , c k i a , c k 0 i n ) <\displaystyle ck_<1f>=f_(ck_,ck_,ck_<0in>)>

Each new circle placed in the gap makes three new gaps (trifurcation).

Algorithm for programmers Edit

Because all circles are inscribed in outer circle so it is easier to start from it.

Then centers of these circles are vertices of equilateral triangle, with side of the triangle = 2 ∗ r i <\displaystyle =2*r_> so :

c i b = ( r 0 o u t + r i ) + ( 2 ∗ r 0 o u t − r i − h e g h t ) ∗ i <\displaystyle c_=(r_<0out>+r_)+(2*r_<0>out-r_-heght)*i>

c i c = ( r 0 o u t − r i ) + ( 2 ∗ r 0 o u t − r i − h e g h t ) ∗ i <\displaystyle c_=(r_<0out>-r_)+(2*r_<0>out-r_-heght)*i>

  • compute inner circle 0 i n c k 0 i n = f p p ( c k i a , c k i b , c k i c ) <\displaystyle ck_<0in>=f_(ck_,ck_,ck_)>
    • “Now we have a configuration to start” [11] There is 6 gaps to fill. 5 gaps are easy and one gap 1 c <\displaystyle 1c>is hard to fill.

    Relation betwen circles Edit

    Number of circles Edit

    • number of new circles at stage n = 2 ∗ 3 n <\displaystyle 2*3^>
    • total number of circles after n stages = 2 + 3 n + 1 <\displaystyle 2+3^>
    • stage -1 = initial cofiguration ( 3 inner circles )
    • stage 0 gives 2 new circles ( one outer and one most inner ). All circles = 5
    • stage 1 gives 6 new circles ( all circles = 11 )
    • stage 2 gives 18 new circles ( all circles = 29 )
    • stage 3 gives 54 new circles ( all circles = 83)
    • stage 4 gives 162 new circles ( all circles = 245)
    • stage 5 gives 486 new circles ( all circles = 731)
    • stage 6 gives 1 458 new circles ( all circles = 2 189 )
    • stage 7 gives 4 374 new circles ( all circles = 6 563 )
    • stage 8 gives 13 122 new circles ( all circles = 19 685 )
    • stage 9 gives 39 366 new circles ( all circles = 59 051 )
    • stage 10 gives 118 098 new circles ( all circles = 177 149 )
    • stage 11 gives 354 294 new circles ( all circles = 531 443 )
    • stage 12 gives 1 062 882 new circles ( all circles = 1 594 325 )
    • stage 13 gives 3 188 646 new circles ( all circles = 4 782 971 )
    • stage 14 gives 9 565 938 new circles ( all circles = 14 348 909 )
    • stage 15 gives 28 697 814 new circles ( all circles = 43 046 723 )
    • stage 16 gives 86 093 442 new circles ( all circles = 129 140 165 )
    • stage 17 gives 258 280 326 new circles ( all circles = 387 420 491 )
    • stage 18 gives 774 840 978 new circles ( all circles = 1 162 261 469 )
    • stage 19 gives 2 324 522 934 new circles ( all circles = 3 486 784 403 )
    • stage 20 gives 6 973 568 802 new circles ( all circles = 10 460 353 205 )

    It can be computed using this Maxima CAS code :

    Number of circles grows rapidly and makes problems caused by big file size. One can :

    • use only stages up to 5-7. It seems to be sufficient to give good image in a short time. [12]
    • do not draw circles which are small ( have a small radius [13]
    • convert svg file to png ( for example using Image Magic : “convert a.svg a.png” ). Then for stage 12 svg image has 128 MB and png file only 57 KB.
    • be happy that you have so detailed picture and wait a long time to load file or see how system hangs up (:-))

    Curvatures Edit

    Note that only one curvature has been computed with f m <\displaystyle f_<\color m>> function.

    All the rest have been comuted with f p <\displaystyle f_

    > function.

    “After a certain high level of technical skill is achieved, science and art tend to coalesce in esthetics, plasticity, and form. The greatest scientists are always artists as well.” —Albert Einstein

    Thursday, June 2, 2011

    How to create an apollonian gasket

    It’s happening again — three tests in one week. The only thing quelling my aching brain is a moderately delicious cupcake and coffee from the OU cafe. Internet window shopping helps, too.

    Seriously, for the love of god, I cannot wait until the weekend. I could go for some Chobani yogurt right now.

    so \m/ metal \m/

    this video is bitchin’

    Tuesday, May 31, 2011

    Why hello blog, we meet again. I’m currently camped out at San Jose International Airport drinking coffee-flavored chocolate milk (iced caffe mocha from Peet’s) utilizing the complementary wi-fi provided by this fine establishment. It’s worth noting I’m typing this on my ancient iPhone.

    #1, always, is seeing my boyfriend 🙂
    #2, California sunshine. I’m rocking a slight hint of color without looking used & abused. Horray for vitamin D!
    #3, Santa Cruz & UCSC. We stayed a skip away from UCSC — which offers one of the only science writing programs in the country. Given that it was Memorial holiday I didn’t have time to check it out. Santa Cruz is full of awesome spots to chill and shop but it’s extremely bum-friendly. Seriously — while seeking out a bar downtown, I overheard two floaters having a scuff because, allegedly, one pulled switchblade on the other in a church parking lot. I digress.
    #4, Firefly mango black iced tea.

    **Ugh, my phone is giving me troubles, will update with more later.**

    Tuesday, May 10, 2011

    I see you baby, shakin’

    This is too funny.

    Saturday, May 7, 2011

    I’m not a huge drinker but.

    Friday, May 6, 2011

    “buck melanoma, moley russell’s wart”

    I’m exhausted! Week one is over and I’ve got gnarly shin splints. School is stressful and since the weather broke I have no excuses. I have too many lazy, duldrumy days during winter. I pack on ten lb’s while chillaxing in my warm living room watching Wife Swap marathons. I get it but then again my grades tend to dip during this time. The classic combo of winter funk and seasonal depression. Does ash tray gray snow lumped up on the curb make anyone feel good? No, I don’t think so.

    I wrote the above yesterday but fell asleep before finishing. My first math quiz was a buzz kill. I’M NOT RAIN MAN and given I’m taking a ‘remedial course’ for math non-geniuses, I CANNOT DO SIX PROBLEMS IN A COOL 15 MINUTES. My test taking skills fall short and I believe slow and steady wins the race when it comes to double checking. It’s not beyond me to bubble in the wrong column on a standardized test (see my ACT) because I easily fluster. On a high note, yesterday’s Japanese quiz went swimmingly.

    Welp, I’m at a loss for words because I don’t understand the correlation between beauty and skin resembling the nommy, crusty deep fried bits found in a bucket of KFC’s finest. My youngest cousins are hypnotized by tanning beds and no matter how much I drill into them that ‘exposure to UV light increases your chances of developing skin cancer’ they don’t seem to give (excuse my cuss) a flying fuck. Is my approach wrong? Probably, but I’m extremely moved by this video I watched courtesy of reddit created by the David Cornfield Memorial Fund (dcmf.ca). This message is one worth spreading!

    I’ve been recently fascinated by the beauty, symmetry and mathematical richness of the Apollonian gaskets.

    How to create an apollonian gasket

    So I felt myself challenged to see if it was possible to generate one in Mathematica with a very short code, guided by the belief that “Beautiful math can often also be very simple“.

    The result I came up with is the following code:

    Not bad for a minimalistic code, also considering that I found a simpler/shorter translation of Descartes formula to be used in my case.

    Above code was short enough (124 characters) to be accepted and published as a tweet by Tweet-a-Program ‏@wolframtap (here’s the link).

    How to create an apollonian gasket

    Anyway the Apollonian gasket produced by the short code quoted above is not complete, as it only produces the circles tangent to the outer circle and not the inner ones.

    It’s surely possible to realize some longer code to produce a full Apollonian gasket (with a parameter to set the limit for the number of iterations) drawing also the inner circles. There are good examples of full programs already done by others (like this)

    But my question is whether such program can be reduced to a minimum length (I suppose it could be done with about 500 characters or less).

    Amongst all the possible variations I’m interested on the basic Apollonian gasket generated by the outer circle (curvature -1) and 2 congruent inner circles with curvature 2 (model -1, 2, 2 as in the image above). That initial condition could generate, in sequence, the other circles with curvatures 3, 6, 15, 11, 14, 23, 38, 35. using the Descartes’ theorem formula.

    My guess is that a very smart program (probably based on a Nest command) could be used in a very condensed code, also taking advantage of the symmetries of the gasket.

    Any suggestion for the shortest possible code?

    Slope Formula Tutorial for UltraFractal – Page 8

    Apollonian Gasket

    The Apollonian Gasket is probably the best known of the circle inversion fractals. It is described at the Mathworld web site and many other places on the web. It has a fractal dimension of approximately 1.3058. and corresponds to a limit set that is invariant under a Kleinian group (see the section on Kleinian Group Fractals). It is created by iteratively carrying out circle inversions on three mutually tangent circles of the same radius. There are four circles that are mutually tangent that do the inversions, three outside circles and one inner circle.

    There are two Apollonian Gasket formulas that use that use the slope algorithm, one is in reb.ufm and the other is in reb.ucl. There is some redundancy between the two formulas, but both will be treated here. The two formulas are Slope Apollonian Gasket (the ufm) and Apollonian Gasket (the ucl). Both formulas require specialized gradients to get realistic ray trace-like coloring. In addition there is a transform that is intended to be used with both of these formulas that is in reb.uxf. It is also called Apollonian Gasket. The following parameters are in common with both formulas and the transform (only selected parameters are listed):

    • Max Iters – This is the maximum number of circle inversion iterations.
    • Smallest Circle – This is the “bailout” for circle inversions. Iteration continues until the circle size is less than the smallest circle.
    • Show Base Set – These are the three circles that are iterated through circle inversions.
    • Perturb Type – This is an interesting option. With the standard Apollonian Gasket four mutually tangent circles are used as the inversion circles. The perturbations create overlap between the inversion circles. The positions of the initial circles to invert have to be adjusted so that they are still orthogonal to the inversion circles. Only certain defined amounts of overlap will still generate a fractal gasket structure. You probably won’t find anything on this anywhere on the web. If you do, please let me know.
      • None – No perturbation. This is the standard Apollonian Gasket.
      • Outer circles – The outer inversion circles are repositioned to create overlap.
      • Inner circle – The inner circle is resized to create overlap.
    • Perturb Level – This parameter is visible only if Perturb Type is not equal to “None”. Overlap of the inversion circles increases with increasing Perturb Level.
    • Magnification – The magnification parameter on the Location Tab, and zooming in the fractal window do not work with these formulas. Use the Magnification parameter in the formula instead.

    The following parameters are common to the ufm and the ucl:

    • Solid Backgound – If checked, background color (and transparency) is controlled from the Outside Tab.
    • Fill Type – This determines the lighting shape for the iterated circles.
      • Quartic1 – This is the ellipsoid lighting:
      • Quartic2 – Hyperboloid lighting #1:
      • Quartic3 – Hyperboloid lighting #2:
      • Quartic4 – Hyperboloid lighting #3:
    • Power – The power in the Quartic formulas.
    • alpha – See the Quartic formulas.
    • beta – See the Quartic formulas.
    • gamma – See the Quartic formulas.
    • global fBm weight – The two global fBm parameters are unique in that they perturb the structure of the gasket shapes and not the coloring of the shapes. They put texture on the shape surface so that light reflecting off the surface shows the texture. This parameter determines the intensity of the texture.
    • global fBm scale – Determines the scale of the texture.

    The following parameters are for coloring the ucl:

    • color scale adj – This is an internal adjustment to how the colors in the gradient are used.
    • # of colors – This determines how many colors are used to color the gasket shapes, depending upon the color method. The maximum value is 8.
    • ring width – The formula can create a ring around each gasket shape.
    • ring color – The color of the ring (1-8).
    • color method – All of the coloring methods are done with a modulus of the # of colors.
      • level – color by iteration level
      • size – color by size
      • number – color by index number of the gasket.
      • position – color by position on the screen.

    The user is encouraged to explore any parameters not listed here.

    The first two images show the gradient use for the ufm and the ucl. With the ufm, all gasket shapes, in this case spheres, are colored with the same color. With the ucl, an 8 color gradient is used.

    How to create an apollonian gasket How to create an apollonian gasket
    ApolloBasic
    created with the ufm
    ApolloBasic2
    created with the ucl

    Because the gradients are so critical to creating these images, uprs for the two images follow:

    The next three images are layered images which show off some of the capabilities of the ufm, the ucl and the transform. The first, ApolloOnApollo, layer the ufm and the ucl, taking advantage of the texturing abilities of the formulas. ApolloOuter10 and ApolloInner10 show some perturbation effects, some additional parameter settings, and use of the Apollonian Gasket transform. The user should study the uprs to determine how these images where created.

    Abstract

    Definition of Apollonian gasket. Sphere packing, uniqueness of Apollonian gasket, examples of unbounded Apollonian tilings. Integral solutions to Descartes’s equation, groups freely generated by reflections.

    Keywords

    • Sphere packing
    • Apollonian gasket
    • Arithmetic properties of curvatures of disks in an Apollonian gasket
    • Fibonacci numbers
    • Free groups
    • Groups generated by reflections

    This is a preview of subscription content, access via your institution.

    Buying options

    eBook EUR 24.60 Price includes VAT (Russian Federation)

    Softcover Book EUR 29.99 Price excludes VAT (Russian Federation)

    Hardcover Book EUR 49.99 Price excludes VAT (Russian Federation)

    How to create an apollonian gasket

    How to create an apollonian gasket

    How to create an apollonian gasket

    Notes

    Just as in the real life.

    That is, points with rational coordinates.

    As one of the reviewers pointed out, the quadruple (7, 2, 3, 6) is a counterexample, since 7 is not a sum of three squares.

    I learned from R. Borcherds that this operation is known to mathematicians in England as “English major addition.” It is also the subject of one of the standard jokes quoted in Gelfand’s seminar.

    Guess about the form of the right-hand side of the formula in this case.

    We say that a measure \(\mu\) on [0, 1] is a weak limit of the sequence of measures \(\mu _\) if for every continuous function f on [0, 1], we have \(\lim _\int _<0>^<1>f(x)\mathrm\mu _(x) =\int _< 0>^<1>f(x)\mathrm\mu (x)\) .

    See Info G.

    Bibliography

    M. Barnsley, Fractals Everywhere (Academic, Boston, 1988)

    N. Lesmoir-Gordon, W. Rood, R. Edney, Fractal Geometry (Icon Books, UK/Totem books, USA, 2000)

    F. Soddy, The kiss precise. Nature 7, 1021 (1936)

    K. Stephenson, Circle packing: a mathematical tale. Not. Am. Math. Soc. 50, 1376–1388 (2003)

    R.S. Stricharts, Analysis on fractals. Not. Am. Math. Soc. 46, 1999–1208 (1999)

    A.F. Beardon, in The Geometry of Discrete Groups. Graduate Texts in Mathematics, vol. 91 (Springer, Berlin, 1983)

    J.H. Conway, in The Sensual (Quadratic) Form, with the assistance of Francis Y.C. Fung. Carus Mathematical Monographs, vol. 26 (MAA, Washington, DC, 1997)

    H.S.M. Coxeter, Introduction to Geometry (Wiley, New York, 1969)

    R. Courant, D. Hilbert, Methods of Mathematical Physics, vol. 2 (Wiley, New York, 1991)

    Edgar, in Measure Topology and Fractal Geometry. GTM (Springer, Berlin, 1990)

    J. Elstrodt, F. Grunewald, J. Mennike, in Groups Acting on Hyperbolic Space (Springer, Berlin, 1998). Russian translation in MCCME, Moscow, 2003

    J. Kigami, in Analysis on Fractals. Cambridge Tracts in Mathematics, vol. 143 (Cambridge University Press, Cambridge, 2001)

    B. Mandelbrot, The Fractal Geometry of Nature (Freeman, San Francisco, 1982)

    W.O.J. Moser, H.M.S. Coxeter, in Generators and Relations for Discrete Groups, 2nd edn. Ergebnisse der Mathematik und ihrer Grenzgebiete. Reihe, Gruppentheorie. n.F., vol. 14 (Springer, Berlin, 1965)

    W. Thurston, in Three-Dimensional Geometry and Topology. Princeton Mathematical Series, vol. 35 (Princeton University Press, Princeton, 1997)

    D. Aharonov, K. Stephenson, Geometric sequences of discs in the Apollonian packing. Algebra i Analiz 9, 104–140 (1997). English translation, St. Petersburg Math. J. 9, 509–545 (1998)

    M.T. Barlow, Harmonic analysis on fractal sets. Seminar Bourbaki, Exp. 755, Astérisque 206, 345–368 (1992)

    A.F. Beardon, L. Lorentzen, Continued fractions and restrained sequences of Möbius maps. Rocky Mountain J. Math. 34, 441–466 (2004)

    R. Brooks, The spectral geometry of the Apollonian packing. Comm. Pure Appl. Math. 38, 358–366 (1985)

    R.L. Dobrushin, S. Kusuoka, in Statistical Mechanics and Fractals. Lecture Notes in Mathematics, vol. 1567 (Springer, Berlin, 1993), pp. 39–98

    M. Fukushima, T. Shima, On a spectral analysis for the Sierpiński gasket. Potential Anal. 1, 1–35 (1992)

    R.L. Graham, J.C. Lagarias, C.L. Mallows, A. Wilks, C. Yan, Apollonian packings: number theory. J. Num. Theor. 100, 1–45 (2003)

    E. Kasner, F. Supnik, The Apollonian packing of circles. Proc. Nat. Acad. Sci. USA 29, 378–384 (1943)

    C.T. MacMullen, Hausdorff dimension and conformal dynamics III: computation of dimension. Amer. J. Math. 120(4), 691–721 (1988)

    L. Malozemov, A. Teplyaev, Pure point spectrum of the Laplacians on fractal graphs. J. Funct. Anal. 129, 390–405 (1995)

    E.H. Neville, The structure of Farey series. Proc. London Math. Soc. 51(2), 132–144 (1949)

    R. Rammal, Spectrum of harmonic excitations on fractals. J. Physique 45, 191–206 (1984)

    G. de Rham, Sur les courbes limites de polygones obtenus par trisection. Enseignement Math. 5(2), 29–43 (1959) (French)

    G. de Rham, Sur une courbe plane. J. Math. Pures Appl. (9) 35, 25–42 (1956) (French)

    G. de Rham, Un peu de mathmatiques propos d’une courbe plane. Elemente der Math. 2, 73–76, 89–97 (1947) (French)

    G. de Rham, Sur quelques courbes definies par des equations fonctionnelles. Univ. e Politec. Torino. Rend. Sem. Mat. 16, 101–113 (1956/1957) (French)

    R. Salem, On some singular monotonic functions which are strictly increasing. Trans. Am. Math. Soc. 53, 427–439 (1943)

    Robert S. Strichartz, Taylor approximations on Sierpinski gasket type fractals. J. Funct. Anal. 174, 76–127 (2000)

    A.V. Teplyaev, Gradients on fractals. J Funct. Anal. 174, 128–154 (2000)

    Author information

    Affiliations

    Department of Mathematics, University of Pennsylvania, Philadelphia, PA, USA

    You can also search for this author in PubMed Google Scholar