Code covered by the BSD License  

Highlights from
2D Apollonian gasket with n identical circles

5.0

5.0 | 1 rating Rate this file 9 Downloads (last 30 days) File Size: 4.71 KB File ID: #15987
image thumbnail

2D Apollonian gasket with n identical circles

by Guillaume JACQUENOT

 

20 Aug 2007 (Updated 01 Feb 2009)

Plot a 2D apollonian gasket with n identical circles

| Watch this File

File Information
Description

This function creates and displays 2D Apollonian gaskets.

In mathematics, an Apollonian gasket or Apollonian net is a fractal generated from three circles, any two of which are tangent to one another

The method used to create the Apollonian gasket is based on circle inversion, which is a geometrical transformation acting with a reference circle that modifies points.
In the plane, the inverse of a point P in respect to a circle of center O and radius R is a point P' such that P and P' are on the same ray going from O, and OP times OP' equals the radius squared
OP * OP' =R²

All circles are created using the inversion properties of circles.

Input: This function takes 6 arguments (each argument is optional)
- a positive integer, which corresponds to the number of circles on the first level of the apollonian packing. (3 at least)
- a positive integer, which corresponds to the number of levels of the apollonian. Higher the number of level is, more numerous the circles will be. 10 levels is a quite high value.
- an interger (0 or 1), which allows to display(1) or not(0) the inversion circles
      - an integer (0 or 1), which indicates whether or not a metapost file is created within the results.
      - an integer (0 or 1), which indicates whether or not a SVG file is created within the results.
      - a string which indicates the filename in which results will be printed.
Output: a struture that contains all informations on created circles on each level:
      - S(1) contains all data on level 1, coordinates centers and
          radius of each circle

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
2D Apollonian gasket with four identical circles

MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
28 Aug 2007 James Kleiran

Nice piece of work.

30 Nov 2011 Carl Witthoft

Nice code, but it fails the Apollonian rule when starting with four or more circles. As can be seen in the posted sample image, the second and higher-level circles are not tangent to three circles on the previous level. Something is wrong in the way the inverse-circles are calculated; I haven't tracked down just what.

Please login to add a comment or rating.
Updates
21 Aug 2007

The plot function has been updated, resulting in fast plot, and lower size picture.

14 Jan 2008

A metapost script has been added, enabling the results to be plotted with metapost (mpost)

01 Feb 2009

An SVG script has been added.
The file has been cleaned up.

Tag Activity for this File
Tag Applied By Date/Time
gallery Guillaume JACQUENOT 22 Oct 2008 09:23:35
apollonian Guillaume JACQUENOT 22 Oct 2008 09:23:35
apollonius Guillaume JACQUENOT 22 Oct 2008 09:23:35
gasket Guillaume JACQUENOT 22 Oct 2008 09:23:35
bearing Guillaume JACQUENOT 22 Oct 2008 09:23:35
inversion Guillaume JACQUENOT 22 Oct 2008 09:23:35
fractal Guillaume JACQUENOT 22 Oct 2008 09:23:35
circles Guillaume JACQUENOT 22 Oct 2008 09:23:35
apollonian Adam 01 Jul 2010 13:28:09

Contact us at files@mathworks.com