3

Let's say, there is an arbitrary set of circles with different radiuses.

Have to distribute these circles in this way:

Pretty sure, that first of all need to find R, but don't know how to do it?

UPDATE: Theoretically, this problem could be solved by a simple "brute-force" by setting inner circle radius to smallest one and increasing it step by step while all circles would fit circumference.

But, that's a last resort, hope there is a more elegant way of doing it.

VVK
  • 435
  • 2
  • 27
  • So basically, you need to find the radius for a circle big enough to have all the other circles right? – MinusFour Sep 08 '18 at 14:52
  • Yes, they should be distributed along its circumference in a way shown on the second illustration – VVK Sep 08 '18 at 15:13
  • 1
    Possible duplicate of [Distribute circles around a center circle](https://stackoverflow.com/questions/30426255/distribute-circles-around-a-center-circle) – i alarmed alien Sep 08 '18 at 15:33
  • I have already an algorithm for one size circles, it's just a simple trigonometry since they form a regular n-polygon. Looking for the solution for different radiuses. – VVK Sep 08 '18 at 15:38
  • I am pretty sure that there is a more elegant solution based on pure trigonometry. – VVK Sep 08 '18 at 16:23
  • did you read the wiki link in the comments for that question? – i alarmed alien Sep 08 '18 at 17:30
  • You mean Steiner Chain? Looked even before posting this question. SC is very limited and doesn't fit for any n-set with circles with arbitrary radiuses. And, one more time, it's not a duplicate, cause if you have even circles, all you need is a line: innerCircleRadius = circleRadius / cos((n - 2) * PI / (n / 2); // n - 2, 2 could be less for gaps between circles. – VVK Sep 08 '18 at 17:56
  • What happens if there happens to be small enough circle(s) fitting inside the gaps between those circumferencing and the center one..? – Redu Sep 08 '18 at 18:37

1 Answers1

1

There is a general solution for this posted on StackExchange Mathematics: https://math.stackexchange.com/questions/1407779/arranging-circles-around-a-circle

Regarding your idea of brute-force, we can improve that by using binary search on R instead.

גלעד ברקן
  • 23,602
  • 3
  • 25
  • 61