[Math] How to evenly distribute various sized circles in ellipse shaped area

geometrypacking-problem

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

enter image description here

  • 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.

Best Answer

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.

enter image description here