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}$$



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).$$
