0
$\begingroup$

I have a problem that I have to solve mathematically. I need the solution for drawing circles in a GUI:

enter image description here

I have a rectangle with width $s,$ the height is not important. Inside this rect I draw a circle at $M_1$ with $r_1 = \frac 13 s,$ so $M_1$ is $(\frac 23 s, \frac 13 s).$

I want to draw two additional circles having the same radius $r_2=r_3$ so that all three circles touch each other and the two additional circles touch the border of the rect. So I need to find out $M_2$ and $M_3$ and the radius of the two circles.

There should exist exactly one solution, I could just try to find the needed radius and centers depending on s but it should be possible to calculate that exactly.

  • 0
    I need it for programming (as noticed). It's in Java for Android, but the programming language does not matter for this problem. I have only tried with trial and error to find the centers and the radius.2012-04-19
  • 1
    Needing some mathematics to implement some software does not automatically make that mathematics appropriate to stack-overflow. (Just as questions about archery are off-topic here even if you're writing an RPG.)2012-04-19

1 Answers 1