Apollonian gaskets

Function to compute and display the apollonian gasket of any 3D triangle or 3D regular polygon
Updated 15 Aug 2023
This function requires you to install the four following ones to work (see how to install a function from the Matlab file exchange or simply download them all in the same directory as this one) :
Then first check the examples tab (.mlx file) here on the right for a complete description.
Once downloaded, typewrite 'help lines_intersection' or 'doc lines_intersection' in Matlab console for support.
[To benefit from the file documentation attached, be sure to download the file, not to just copy and paste it.]
For 2D in (Oxy) plane, just padd your input data with some 0 in Z dimension.
Main parameter recommended values :
0 <= nb_it <= 4 (the number of circles increases very rapidly in function of this parameter)
6 <= nb_samples <= 64 (for a quick display, depending on the power of your graphic card)
From the output data (circle centre coordinates vector and circle radius vector), you can retrieve the circle coordinates by rotating the usual 2D circles in the polygon plane (if this one is in 3D). To do so you may find useful the function :
I also added apollonian_spherical_pseudo_gaskets function to compute and display pseudo spherical gaskets from one platonic solid face (regular polygon). Why 'pseudo' ? Since except the largest ones all the others are not actual circles for this function / example. See example below. To run this one for solids #4 and 5 (icosahedron and dodecahedron) you will also need to have the function :
Please don't forget to rate this code if it helped you. Thanks ;-)
Other links I found useful to write this code :

Cite As

Nicolas Douillet (2024). Apollonian gaskets (https://github.com/NicolasDouillet/apollonian_gaskets/releases/tag/v1.0), GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2019b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.