# How to evenly distribute various sized circles in ellipse shaped area?

In my programming project I need to evenly distribute various sized circles in ellipse shaped area.

• The ellipse area is defined by major and minor axis (4 points).
• There is finite number of various sized circles that will all fit into the ellipse.
• The order of the circles does not matter.

What is the criterion that will make them look evenly distributed? I don't think it's same distance between them, this can not even be achieved, can it? What algorithm will make them look as homogeneously distributed as possible?

Thanks for any help.

-

I would resize the circles by a factor $k$ (in the figure $k=2$) so that the maximum number of circles is tangent to the ellipse and among them. To determine their centers I would try to solve this complex packing problem by trial and error, starting with the biggest circle (corresponding to the light blue one in the figure) and proceeding with the smaller ones (corresponding to the dark blue and the two equal sized black ones). The original circles would have the same centers.

-
I will think about this ... meanwhile could you please give it a new tag "packing problem"? I don't have enough reputation to create new tags. Thanks. –  daniel.sedlacek Feb 9 '11 at 18:27
Done. [packing-problem] –  Américo Tavares Feb 9 '11 at 18:50

maybe you can use this formula: http://onlinelibrary.wiley.com/doi/10.1111/itor.12006/full

Also you can find the code in fortran: http://www.ime.usp.br/~egbirgin/packing/ellipses/

-
Bit too heavy math for my mini project but definitely thanks for sharing! –  daniel.sedlacek Jul 25 '13 at 11:04