Find radius of circle laying on another circle I’m building a radial menu in a game engine (Unity). I need to place my menu items in a “carousel”. So, I need to know the size/scale of my items to fit nicely on a circle, forming a circular menu, laying close to each other and covering the whole outer circle. In other words, how many small circles can I put ON a circumference of another, say a unit circle, where center of those smaller  circles lays on the circumference. Or, in yet another words, simply put, say given the size of a ball bearing, how many balls fit inside? Whats the math finding the size/radius of those small circles?
Edited:
I actually needed the r and not the n, so the final equation is indeed

and the code looks like this:

 A: 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$.

A: 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$
A: Here's an approximate calculation that will work if the ball bearings have radius $r$ much less than $1$.
The the center of each ball bearing will be at distance $1-r$ from the center of the unit circle. Those centers will lie on a concentric circle with circumference $2\pi(1-r)$ and will cover a little bit less than $2r$ of that circumference. So you will be able to fit $\pi(1-r)/r$ ball bearings.
