Tangential curve through circles

Hi,

I have these circles, and I want to be able to draw these tangential curves through them - even when the sizes of these circles change - but there will always be a minimum gap between them (they will never overlap). See image below for the curves I’m trying to draw.

Below is a close up showing how they go through the midpoints of the perpendicular lines between the circles.

Apologies for the poorly drawn diagrams in paint!

Below is the grasshopper script with the circles in the diagram.

Tangential curve through circles.gh (9.9 KB)

Thanks!

Andy

there might be much much much easier ways…
expecially, this is not fully automated as you must use the slider to set how many rows of circles you have


Tangential curve through circles_Re.gh (22.2 KB)

Thanks that worked well for what i need!