invert_around#

invert_around(packing, k, smallCircles=None)#

Invert packing so that circle k surrounds the others.

This finds a Möbius transform (via inversion) that places circle k large enough to contain the others, based on a grid search.

Parameters:
  • packing (dict[str, tuple[complex, float]]) – The circle packing to invert.

  • k (str) – Key of the desired outer circle.

  • smallCircles (list[str] | None) – Optional list of keys to consider in optimization.

Returns:

A new packing with optimized inversion.

Return type:

dict[str, tuple[complex, float]]