How so I work out how many circles per ring / which ring a circle is on

2.1k Views Asked by At

Lets say I have a bunch of circles I want to arrange in rings. The circles start in the centre and move to a new ring with a bigger diameter each time an inner ring runs out of room.

How would I know how many rings I would need to fit N amount of items and even what ring a certain circle would end up upon ?

Right now I can brute force it by iterating through the rings but I don't have a nice algorithmn for this. enter image description here