I have a problem that I have to solve mathematically. I need the solution1 for drawing circles in a GUI:
I have a rect with width s, the height is not important. Inside this rect I draw a circle at M1 with r1 = 1/3*s, so M1 is (2/3*s, 1/3*s).
I want to draw two additional circles having the same radius (r2==r3) 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 M2 and M3 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 exaclty..