Find radius of circle laying on another circle

Consider three tangent circles of radii $r$, $r$ and $1$ (WLOG). The centers form an isoceles triangle of sides $r+r$, $1-r$ and $1-r$. The small angle is

$$\theta= 2\arcsin\frac{r}{1-r}=\frac{2\pi}{n}$$ for $n$ small circles, and

$$r=\frac1{\csc\dfrac\pi n+1}\approx\frac\pi{\pi+n}.$$

The exact formula works as of $n=2$.

enter image description here


It might be easier to figure out if you want to put $n$ circles what the radius of those circles would be. Then take the inverse of that function and figure out give the radius how many you can fit. If you fit $n$ circles (assuming $n \ge 4$) you want each circle to span an arch of $\frac {360}n$ and thus it becomes a simply trig problem. The radius of the small circle will be the short leg of a right triangle where the radius of the big circle is the longer leg. The angle of this right triangle is $\frac {\frac {360}n}2=\frac {180}n$.

So if $n$ is the number of circles. $R$ is the radius of the big circle and $r$ is the radius of the small circle we have the following relations.

$\frac {r}{R} = \frac {\sin \frac {180}n}{\cos \frac {180}n} = \tan\frac {180}n$ so

$n = \lfloor \frac {180}{\arctan \frac Rr}\rfloor$