# Calculate radius of variable circles surrounding big circle.

I got a circle, which I know all the details about him. (Radius [100], Diameter [200], Circumference [628.32], Area [31415.93]...)

I would like to surround this circle, with smaller circles. I know the amount of the smaller circles (in this case 14, but it can be less > minimum 4).

I need a formula to calculate the Radius of the smaller circles.

I got the following formula, but this is not right...
R = radius of big circle
n = number of smaller circles
P = tan(360/2n)
r = radius of smaller circles

r = (-(PR))/(P-1)


Here's an example of how it should looks like (this is not right, because I didn't know the Radius of the smaller circles, I just guessed..):

Thank you very much!

-

If you connect the centers of two adjacent little circles and the center of the big one, you'll get a triangle. The sides of this triangle have lengths $r+R, r+R$ and $2r$. A little trigonometry will get you that the top angle is

$$\theta=2\arcsin\left(\frac{r}{r+R}\right) \; .$$

Since you want the small circles to form a closed ring around the big circle, this angle should enter an integer amount of times in $360°$ (or $2\pi$ if you work in radians). Thus,

$$\theta=360°/n \; .$$

From this, you can compute that

$$r=\frac{R \sin(180°/n)}{1-\sin(180°/n)} \; .$$

Here's a plot of the result for $n=14$:

Here's the code in Scilab:

n=14;

R=1;

r=R*sin(%pi/n)/(1-sin(%pi/n));

theta=2*%pi*(0:999)/1000;

plot(R*cos(theta),R*sin(theta));

hold on;

for k=0:(n-1),

plot((r+R)*cos(2*k*%pi/n)+r*cos(theta),(r+R)*sin(2*k*%pi/n)+r*sin(theta));

end;

hold off;

-
Based on my Data, The answer here is 28.6384. I made Circles based on this solution, and I had to make 11 circles in order to surround the main circle which is wrong (3 are missing).... –  Ron Mar 17 '12 at 12:41
It seems to work fine for me, see the added image. I've quickly coded it in Scilab. Do you want me to put the code in the answer? –  Raskolnikov Mar 17 '12 at 13:12
Yes please. I think the problem is with the tools I use. I use CSS to create circles, than slice them in photoshop and arrange them.. I guess the CSS doesnt know to use fractions. –  Ron Mar 17 '12 at 13:21
By the way, coul you add the relevant part of your CSS code in the OP so that I can see if I can help there? –  Raskolnikov Mar 17 '12 at 13:39
As I said, I placed the data in CSS and copied the resulted circle to Photoshop. In Photoshop I arranged the circles... I don't think the CSS will help you –  Ron Mar 17 '12 at 14:13

You have a bigger circle when you connect the centers of smaller circles. So, you have another radius which is (r + R). After you draw a line between two adjacent little circles, there is a triangle for you to apply cos theorem.

Long side's length is r+R and short side is 2r. The angle between two long side is 2n, which is the number of smaller circles around the circle.

Therefore, (2r)^2= 2*(r+R)^2 - 2*(r+R)^2cos(2n) will do the trick, I guess.

-
Based on my Data, The answer here is 19.4795. I made Circles based on this solution, and I had to make 15 circles in order to surround the main circle which is wrong (1 extra).... –  Ron Mar 17 '12 at 12:41