To draw a necklace of n circles internaly tangent to a given circle

circlesgeometry

The below images show n number of circles inside of a circle all inner circles tangent to the surface of the outer circle.

3 circles inside of a circle

4 circles inside of a circle

5 circles inside of a circle

So lets say I have an outer circle in P(x,y) coordinates with radius R. I want to draw n inner as the images above. So what would be their center coordinates and their radius?

Best Answer

I've added a picture below. It is trivial to see that the angle between the origins of two circles side by side is $\frac{2\pi}{n}$. Then the angle $\angle{AOB}=\frac{\pi}{n}$. Now we can use the law of sines: $\frac{r}{\sin(\pi/n)}=\frac{|OB|}{\sin(\pi/2)} \implies |OB|=\frac{r}{\sin(\pi/n)}$. Let's call the radius of big circle $R$. Then, $R=|OB|+r = \frac{r}{\sin(\pi/n)} + r$. Then $r=\frac{R}{\frac{1}{\sin(\pi/n)}+1}$. So, we have the radius of small circles. Let polar coordinates of one of the centers be $|R-r|(\sin\theta+\cos\theta)$. Now we can find the coordinates of other centers as well since we know the angle between them is $\frac{2\pi}{n}$. enter image description here