Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a circle of radius $r$, and I have a bounding box with 4 sides, $a$, $b$, $c$ and $d$ as illustrated in the below diagram:

Here are a few constraints

$$r \geq a$$ $$r \geq b$$ $$c >> a$$ $$d >> a$$ $$c >> b$$ $$d >> b$$

$a$ and $b$ must be perpendicular to $d$ segment.

Another condition is that the the circular sectors must touch one of the long line segment ( the top line segment in this case), base on another long segment ( the bottom line segment in this case) and must not go out from it.

What is the algorithm/equation that allows me to generate all the circular sectors that

  1. Touch one of the line segments
  2. Won't go out from it
  3. Fill the bounding box ( as defined by $a$, $b$, $c$ and $d$) as compactly as possible?
share|cite|improve this question
I think you haven't explicitly mentioned all the constraints that you are implicitly assuming. Apparently your box doesn't need to be a rectangle. Are you demanding (in (1)) that all segments are tangent to the same side of the box? Are you also demanding that all segments have their terminal ends on the same side of the box (as in the diagram)? And presumably this side must be the side opposite the side to which the segments are tangent. A single circular segment tangent to $a$ and terminating at $c$ and $d$ can fill an arbitrarily large proportion of the volume of the box. – yasmar Dec 8 '10 at 17:11
@yasmar, not sure what you mean by the last sentence. Such a circle segment can't fill an arbitrarily large proportion because sooner or later it will go out from $c$. Also I've addressed your other concerns in the updated question. – Graviton Dec 9 '10 at 1:16
"a and b must be tangential to d segment": that can't be right. Do you mean transversal? Perpendicular? – Willie Wong Dec 9 '10 at 2:14
@It's perpendicular. – Graviton Dec 9 '10 at 2:24
What you have drawn is not what is usually called a circular sector. Perhaps you mean a circular segment ? – lhf Jun 7 '11 at 11:52

There is quite a bit of information on circle packing on packomania, including packings in rectangles. So some of it may be of use to you.

Here's another page on the same theme.

share|cite|improve this answer
I'm looking for circle sectors packing, not full circle packing. – Graviton Dec 8 '10 at 12:27
@Ngu No problem, I just thought it was worthwhile making you aware of the site in case there was something there that you could use. – Derek Jennings Dec 8 '10 at 14:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.