Algorithm for placing circles of Diameter d around the edge of another circle with diameter D [closed]

Hi i'm struggling with what i think may be simple maths. I need to place circles of a small size around the edge of larger circle.. is there an algorithm to calculate the angle for each small circle from the x-axis, counter clockwise? then using this angle i can find the Cartesian coordinates (x,y) of the enter of each circle.

closed as off-topic by Evil, David Richerby, vonbrand, Discrete lizard♦Aug 12 at 7:13

• This question does not appear to be about computer science within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

• I'm voting to close this question as off-topic because it is about elementary trigonometry, not computer science. – David Richerby Aug 9 at 14:55

Circles centers form isosceles triangle with base of length $$2r$$ and arms of length $$R+r$$, so $$\tan (\frac{\beta}{2}) = \frac { r}{ r+R}$$ hance $$\beta = 2\arctan(\frac{r}{r+R})$$