# Fitting circles inside other circles

• I
• Featured

## Main Question or Discussion Point

I'm working on the following fun problem.
I have a circle of a given radius, R0. (Green circle in the image).
I want to be able to supply a radius of the first circle that is to fit into this large circle. Lets say R1 is 0.75 * R0.
Following this I find the best position of R2 (to maximise its radius), is on top of the smaller circle.
This is the largest circle that can fit inside the green circle without overlapping the red circle or going out of the green circle.

I can calculate its radius and position easily. I now want to place the next largest circles next to the white circle - there will be two of equal diameter, next to the white and touching the white and red and border of green. I do not know how to calculate their radius or position.

I've included the html to generate the above placement with R1=0.75 R0.
When R1 is altered the white circle automatically changes size.
In the image below the blue circles represent the next largest circles that can be fitted. I expect there should be an infinite series of circles getting smaller and smaller. I would like to be able to calculate their placement and radius, leaving only R1 (red circle) as a variable that can be altered and all the other circles should get rendered automatically.

#### Attachments

• 1.5 KB Views: 209

mfb
Mentor
You can set up equations for points on all those circles, your new circle is then given by the parameters where the intersection with all three circles is exactly one point. It is also the smallest circle that has common points with all three circles. Solving those equations can be messy.

Homework Helper
Gold Member
I have something that might simplify things a little. Given ## R_0, R_1, R_2 ##, let's find the location of a circle of radius ## R_3 ## that makes contact with ## R_1 ## and ## R_2 ## at one point. To make it simpler, put the origin at the center of ## R_1 ## and make the center of ## R_2 ## lie along the x-axis. Use the law of cosines to write ## (R_2+R_3)^2=(R_1+R_2)^2+(R_1+R_3)^2-2(R_1+R_2)(R_1+R_3)cos(\theta) ##. (We solve this for ## \theta ##.)The center of the circle of radius ## R_3 ## has location (x,y) coordinates ## ((R_1+R_3)cos(\theta),(R_1+R_3)sin(\theta)) ##. (Call this ## (h_3, k_3) ## ). It remains to find the ## R_3 ## so that this circle intersects the ## R_0 ## circle at only one point. I think this might have a simple solution: Given centers ## (h_0,k_0) ## and ## (h_3,k_3) ## , you need to solve ## (h_0-h_3)^2+(k_0-k_3)^2=(R_0-R_3)^2 ##. (You don't even need the (x-h)^2+(y-k)^2=r^2 forms for the circles.)That should give ## R_3 ## and we already have the location of the center ## (h_3,k_3) ## as a function of ## R_3 ##. (A diagram would help, but my "Powerpoint" skills are lacking. Hopefully you can follow how the law of cosines was set up for the triangle, etc.)..editing... I worked through the equations=I don't know that my algebra was flawless=I will need to check it, but the answer I got is ## R_3=(R_1 R_2)(R_1+R_2)/(R_1^2+R_1 R_2+R_2^2) ##. (Note: I edited this answer once because I missed the sign on the ## R_2^2 ## term in the denominator. I think it may now be correct.) @mfb I think I have a solution for ## R_3 ##. With a slight modification (this one assumes circles 1 and 2 lie on the diameter of ## R_0 ##), this method could be used to solve for any of the circles in the sequence.

Last edited:
Homework Helper
Gold Member
The formula I computed above ## R_3=(R_1 R_2)(R_1+R_2)/(R_1^2+R_1 R_2+R_2^2) ## appears to be correct, at least with a couple of quick checks. When ## R_1=R_2 ##, it gives ## R_3=(2/3)R_1 ##. When ## R_0=4, R_1=3, R_2=1 ## it gives ## R_3=12/13 ##. Perhaps someone could check this case with a good graphics package, but I do think it may be correct.

Nidum
Gold Member

Homework Helper
Gold Member
The only difference in doing subsequent circles is, instead of the center of the biggest circle being at ## (h_0,k_0) =(R_0-R_1,0) ##, as it was in post ## 3 ##, it will be at some rotated coordinate. (Rotation is always about the center of ## R_1 ## and it is an angle given by the ## \theta ## for the previous circle.) I do think the solution for subsequent circles will remain somewhat simple algebraically, how it was for ## R_3 ## in post 3 where it turned out to simply be a linear equation for ## R_3 ##... editing.. Some subsequent calculations yielded a ## sin(\theta) ## term along with the ## cos(\theta) ## term for this more general case. Thereby, a numerical answer for given ## R_0,R_1 ,R_2, ## and ## R_3 ## ... is readily obtained, but a general expression, such as that for ## R_3 ## above would be much more difficult to compute.

Last edited:
Homework Helper
Gold Member
The OP doesn't appear to have returned yet= @micromass This is an interesting one, and it actually has a somewhat simple closed form for ## R_3 ##. (see my post 3). Perhaps you will find it of interest.

Nidum
Gold Member
The locus of the centres of the small circles is also a circle ?

Last edited:
Nidum
Gold Member

Last edited:
Homework Helper
Gold Member
View attachment 105222 The locus of the centres of the small circles is also a circle ?
Quite an interesting observation. It looks like it has a good chance of being correct. The closed form of ## R_4 ## is proving to be a little difficult, but this could prove to a very good find if it is correct. I think the center would lie at ## (R_2/2,0) ## if it is the case. (Midpoint of ## (-R_1,0 ) ## and ## (R_1+R_2,0) ##.) Will need to check and see if ## (h_2,k_2) ## and ## (h_3,k_3) ## are equidistant from this point....editing...My algebra is not infallible, but it appears from preliminary calculations that the centers do not form a circle.

Last edited:
Let ##1## and ##1## be the radii of the internal circles. Then ##2## is the radius of the external circle. The curvatures are thus ##1/2## and ##-1## and ##-1##. The curvature of the ##n+1##th circle is ##z_{n+1}## given by

$$z_{n+1} = z_n -\frac{1}{2} - \sqrt{2} \sqrt{ -z_n -1 }$$

The general solution to this recurrence problem is

$$z_n = - \frac{1}{4}((\alpha - \sqrt{2}n)^2 + 4)$$

We know that ##z_0 = -1## and thus ##\alpha=0##. We get

$$z_n = - \frac{n^2 + 2}{2}$$

Thus the radius of the ##n##th circle is
$$R_n = \frac{2}{n^2 + 2}$$

For the general solution, you can find for any three points a Möbius transformation sending them to 3 arbitrary distinct points. This Möbius transformation respects circles and tangency, so you can bring back any situation to the one I just covered.

Homework Helper
Gold Member
Let ##1## and ##1## be the radii of the internal circles. Then ##2## is the radius of the external circle. The curvatures are thus ##1/2## and ##-1## and ##-1##. The curvature of the ##n+1##th circle is ##z_{n+1}## given by

$$z_{n+1} = z_n -\frac{1}{2} - \sqrt{2} \sqrt{ -z_n -1 }$$

The general solution to this recurrence problem is

$$z_n = - \frac{1}{4}((\alpha - \sqrt{2}n)^2 + 4)$$

We know that ##z_0 = -1## and thus ##\alpha=0##. We get

$$z_n = - \frac{n^2 + 2}{2}$$

Thus the radius of the ##n##th circle is
$$R_n = \frac{2}{n^2 + 2}$$

For the general solution, you can find for any three points a Möbius transformation sending them to 3 arbitrary distinct points. This Möbius transformation respects circles and tangency, so you can bring back any situation to the one I just covered.
@micromass Thank you for your input. I'm still trying to figure it out in its entirety, but the case you showed for two equal circles of ## R=1 ## gives for n=1 that ##R_1=2/3 ## which is in agreement with what I called ## R_3 ## above for ## R_1=R_2=1 ##.

Homework Helper
Gold Member
Descartes formula agrees with the ## R_3 =12/13 ## that I got for the case of ## R_1=3 ## and ## R_2=1 ##.

Let the first circle be around ##(2,0)## with radius ##2##. Let the second circle be around ##(1,0)## with radius ##1##. Then circle ##n## is around

$$C_n = \frac{6}{n^2 + 2} + \frac{4n}{n^2 + 2} i$$

It can be easily checked that these all lie on the curve with equation ##32x^2 - 96x + 36y^2 = 0##, which is thus not a circle (as was asked in post 9) but rather an ellipse.

Homework Helper
Gold Member
Let the first circle be around ##(2,0)## with radius ##2##. Let the second circle be around ##(1,0)## with radius ##1##. Then circle ##n## is around

$$C_n = \frac{6}{n^2 + 2} + \frac{4n}{n^2 + 2} i$$

It can be easily checked that these all lie on the curve with equation ##32x^2 - 96x + 36y^2 = 0##, which is thus not a circle (as was asked in post 9) but rather an ellipse.
Thank you @micromass Looks to me to be kind of a general result that the points will form an ellipse. Still a very heads-up observation by @Nidum that the points made some kind of regular smooth curve.

Let the first circle be around ##(2,0)## with radius ##2##. Let the second circle be around ##(1,0)## with radius ##1##. Then circle ##n## is around

$$C_n = \frac{6}{n^2 + 2} + \frac{4n}{n^2 + 2} i$$

It can be easily checked that these all lie on the curve with equation ##32x^2 - 96x + 36y^2 = 0##, which is thus not a circle (as was asked in post 9) but rather an ellipse.
Very interesting though: the foci of the ellipse seem to be exactly the center of the big circle and the center of the small circle!

Homework Helper
Gold Member
Let the first circle be around ##(2,0)## with radius ##2##. Let the second circle be around ##(1,0)## with radius ##1##. Then circle ##n## is around

$$C_n = \frac{6}{n^2 + 2} + \frac{4n}{n^2 + 2} i$$

It can be easily checked that these all lie on the curve with equation ##32x^2 - 96x + 36y^2 = 0##, which is thus not a circle (as was asked in post 9) but rather an ellipse.
Thank you @micromass I worked through your parametric equations for location of the center (replacing "n" by t) and the result is the ellipse that you computed.

jim mcnamara
Mentor
We have a good set of answers so let's say 'thanks' for the help. Thread closed.