# Apollonian Packing of Circles within Ellipses
## 1 Introduction  
Circle packings achieve the optimized filling of a generic finite plane region with a number of non-overlapping circles. Such topic has aroused a great interest in mathematics, physics, geophysics and operational research and has been fruitfully applied to a large variety of problems in logistics and technology [1]. A nonlinear programming-based algorithm for the packing of circles within ellipses is proposed in [2], achieving covering with a finite amount of equal-radius enclosed circles for global optimization purposes. The well-known Apollonian circle packing (or Apollonian gasket) achieves the filling of a bounded or unbounded plane region with an infinite number of mutually tangent smaller circles of decreasing radii, internal or tangent to the outer boundary, by iteratively or recursively filling the interstices left between tangent circles [3]. Such geometrical arrangement has been used in a variety of physical models, and its generalization to space-filling bearings has been applied to the understanding of geological sheer bands [4; 5]. The construction of an Apollonian circle packing, granted by an ancient theorem of [PERSON], may be reduced to an elementary geometric problem, i.e., the search for a circle that is tangent to three mutually tangent circles given their three centers and radii. The first solution to this fundamental problem is ascribed to [PERSON] in 1643, to be independently rediscovered by Sir [PERSON] as the Kissing Circles problem in 1936 [6]. The solution may undergo a simple formulation in the complex domain [7], ready for straightforward application in a numerical algorithm. In addition to the algebraic solution of the problem by means of the [PERSON] theorem, a classical geometrical construction of a circle that is tangent to three other given circles by means of rule and compass is available [8], and a very elegant and mathematically revealing approach based on circle inversion mapping in the complex plane [9] is commonly used in implementations [10]. The aforementioned solution methods are not easily extensible to the case of an elliptical outer boundary. To overcomethis limitation, we developed an elementary interpretation of the construction of tangent packing circles, which is based on the so-called menaechmics, i.e., the search for solutions to an algebraic or geometric problem by means of intersections of conic sections [11]. The proposed Menaechnic method, applied to the construction of Apollonian circle packings within ellipses, has proved to grant suitable speed, accuracy and stability. The novelty of the proposed approach consists in its applicability to the packing of a generic, closed, convex contour, if the parametrization of its outer boundary is given. The present work was developed within a research program on electromagnetic field scattering using elliptic, cylindrical dielectric structures, stemming from the need to simulate a dielectric cylinder of arbitrary cross-section with a finite number of circular dielectric cylinders enclosed within the assigned arbitrary contour [12; 13; 14; 15]. For this purpose, Apollonian circle packing achieves the covering of a circular, elliptic or generically closed contour, optimizing the number of mutually tangent smaller circles and consequently reducing the computational complexity of simulations.  
In Section 2 of this paper, an algorithm achieving Apollonian circle packing within an elliptic domain is described, together with its implementation in a specific code. In Section 3, results are presented and discussed. Conclusions are given in Section 4.