Formula for minimum distance for circles what won't touch each other depending on n?

114 Views Asked by At

Let's say that I have a circle, which is the "middle circle" (red in the pictures below). I also have a number (n) of identical circles, that should appear around the middle one, without touching. For the first few Ns, they can basically hug the middle circle (without touching), and they will fit. At some point, there will be too many, so they will have to be further and further away from the middle circle, to maintain that round formation without touching each other.

I am wondering if there is a formula, that given n the number of outer circles, d the starting angle (there will always be a circle at this angle if n > 0), and k the (constant) minimum distance between two circles (always >= 0, so that they won't touch), and i the circle number, I could get its exact location (assuming the middle circle is at (0, 0)), or just its distance from the middle circle?

A picture is worth a thousand words, so here is what the first few Ns would look like.

Please forgive the horrible paint drawings.

A few of the first Ns

So what formula could I use in that situation?