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



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