Let's get a figure in here, eh?
We can exploit the fact that the points of mutual tangency of the three inner circles (red points in the figure) form an equilateral triangle; we also know that the red points are the midpoints of the segments formed by joining any two of the three blue points (the centers of the inner circles).
We then deduce that the triangle formed by the red points is half the scale of of the triangle formed by the blue points, and find that the equilateral triangle formed by the blue points has a side length of 6 ft., and that the inner circles have a radius of 3 ft. Using the law of cosines, we reckon that the distance from a blue point to the center of the triangle formed by the blue points is $2\sqrt{3}$ ft. Adding to that the radius of an inner circle, we find that the radius of the outer circle is $3+2\sqrt{3}$ ft.
The area of the outer circle is $\approx$ 131.27 square feet.
You already have a formula for finding the center of one of the
small circles:
x = xBigCircle + Math.round(200 * Math.cos(phi));
y = yBigCircle + Math.round(200 * Math.sin(phi));
Since you want the small circles all to be the same size and each one
is the same distance from each of its neighbors, they will be evenly
spaced around the circle. Since one full turn around the circle is
the angle 2 * Math.PI
, you want one eighth of that, which is
0.25 * Math.PI
. Stepping by that angle around the circle eight
times, starting at the first circle, gets you back to the first circle
while finding seven other equally-spaced points.
The centers of the small circles should be at
x = xBigCircle + Math.round(200 * Math.cos(phi + n * 0.25 * Math.PI));
y = yBigCircle + Math.round(200 * Math.sin(phi + n * 0.25 * Math.PI));
where n
ranges from $0$ through $7$, inclusive
($0 \leq n < 8$).
The value $n=0$ is just the center of the first small circle,
which you already know.
To make a "gap" of size $20$ between each pair of small circles,
just set the radius of the small circles accordingly.
The distance between centers is 200 * 2 * Math.sin(Math.PI/8)
,
subtract $20$ from that for the desired gap, then divide by $2$
to get the desired 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}$.