What is the required radius of the smaller circles around a larger circle so they touch? I am trying to determine how to calculate the required radius of the smaller circles so they touch each other around the larger circle. (red box) 
I would like to be able to adjust the number of smaller circles and the radius of the larger circle.
As an example:
$$\begin{align}
R&=1.5\\
n&=9\\
r&=\,?
\end{align}$$


 A: Another approach: Lets say we have $n$ small circles. Then the center points of the small circles form a regular $n$-gon, where the side length is $2r$. The radius of the big circle is the circumradius of the $n$-gon which is $R = \frac{2r}{2\sin(\pi/n)}$ so $r = R \sin(\pi/n)$
A: If you draw $n$ lines from the origin touching the small circles and $n$ lines from the origin to the center of each small circle you basically divide the $2 \pi$ angle into $2n$ equal angles, say $\theta$. Hence $\theta={\pi}/{n}$. Now a triangle with vertices the origin, the center of one of the small circles and a tangent point of the same circle is a right triangle since the tangent is perpendicular to the radius at the point of contact. You then have
$$
\sin \theta=\frac{r}{R}
$$
Putting it all together 
$$
r=R \sin \frac{\pi}{n}
$$
A: Suppose that the center $c_k,k=1,\ldots,n$ of the small circles are placed equidistantly on the bigger circle.
Then we have $c_k=\left(R\sin(2\pi\frac{k}{n}),R\cos(2\pi\frac{k}{n})\right), k = 1,\ldots,n$. So for $k=1,\ldots,n$ we must have $r=\frac{\|c_{k}-c_{k+1}\|_2}{2}$, since two circles with same radius are tangent if their radius is the half of the distance between their centers. In particular $$r=\frac{\|c_{n-1}-c_{n}\|_2}{2}=\frac{1}{2}\sqrt{\big(R\sin(2\pi)-R\sin\big(2\pi\frac{n-1}{n}\big)\big)^2+\big(R\cos(2\pi)-R\cos\big(2\pi\frac{n-1}{n}\big)\big)^2} \\ =\frac{R}{2}\sqrt{\sin\big(2\pi\frac{n-1}{n}\big)^2+\big(1-\cos\big(2\pi\frac{n-1}{n}\big)\big)^2} \\ = \frac{R}{2}\sqrt{2-2\cos\big(2\pi\frac{n-1}{n}\big)} =\frac{R}{2}\sqrt{2\Big(1-\cos\big(2\pi\frac{n-1}{n}\big)\Big)}\\
=\frac{R}{2}\sqrt{4\sin\big(2\pi\frac{n-1}{n}\big)^2}=R\sin\big(\pi\frac{n-1}{n}\big)=R\sin\big(\frac{\pi}{n}\big).$$
