5
$\begingroup$

Given the dimension of a rectangle and radii of two circles, how can I decide if these two circles can fit in the rectangle?

I don't know if there is a formula to compute such a thing!

thank you :)

$\endgroup$
1
  • $\begingroup$ Well, to pack one circle in its diameter must be equal or smaller to the smaller sides of the triangle. so to pack two circles in they must each have diameters smaller than the smaller side and the sum of the diameters must be less than that larger side. So if the rectangle is 8 by 13 the diameters must each be less than 8 and the sum of the diameters must be less than 13. If your circles are 5 diameter, and 6 diameter they'll fit into any rectangle larger than 11 by 6. $\endgroup$
    – fleablood
    Commented Jan 1, 2017 at 17:31

2 Answers 2

5
$\begingroup$

In the figure below, let circle $E$ have radius $r_1$, circle $G$ have radius $r_2$ and the rectangle be $H$ high and $W$ wide. You get the best fit by putting the circles in opposite corners. First you need $H,W \gt 2r_1, 2r_2$ or one of the circles won't fit all by itself. Then the coordinates of $E$ are $(r_1,H-r_1)$ and the coordinates of $G$ are $(W-r_2,r_2)$. You need them to be at least $r_1+r_2$ apart, so the requirement is $$\sqrt{(W-r_1-r_2)^2+(H-r_1-r_2)^2} \gt r_1+r_2$$

enter image description here

$\endgroup$
3
  • $\begingroup$ Isn't that rather complicated? If instead of measuring corners you measured tangents to sides you'd get the far simpler $2(r_1 + r_2) \le \max (W,H)$ and $2\max(r_1,r_2) < \min (W, H)$. $\endgroup$
    – fleablood
    Commented Jan 1, 2017 at 17:40
  • 1
    $\begingroup$ @fleablood: No, you don't need the long side as long as the sum of the diameters. As my figure suggests, the diameters can overlap. For a simple example, put two equal circles in a square. The diagonal has a diameter plus $\sqrt 2$ times a diameter, so is $(2+2\sqrt 2)r$, which allows a diameter of $2-\sqrt 2$ times the side, greater than half the side. Taking your example of circles of diameter $5$ and $6$ in a rectangle of height $6$, you only need $\frac {11}2+\sqrt{30} \approx 10.977$ of length $\endgroup$ Commented Jan 1, 2017 at 17:57
  • $\begingroup$ Oh, good point. $\endgroup$
    – fleablood
    Commented Jan 1, 2017 at 19:40
-2
$\begingroup$

To pack two circles tightly together is to touch them tangently. The rectangle must be as wide as the longer diameter and the longer side as long as the sum of the diameters.

So if circle one has diameter = $d_1$ and circle two has diameter = $d_2$ and $d_1 \ge d_2$ and the rectangle has sides $l$ and $w$ and $l \ge w$, then the two circles will fit if $d_1 \le w$ and $d_1 + d_2 \le l$.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .