For DIY project, I need to calculate the perimeter (the blue line) of this shape - a circle resting on a middle of the line:
I know the radius of the circle (r) and the length of the line (a). If I remember correctly, b should be equal to a / 2 (right?)
so, it gives me:
p = 2a + c
But how do I calculate the length of the arc (c) ?
I'd appreciate if someone can explain how they got to the formula, so I can use in the remaining parts of the project.
Thanks.
(edit: changed the drawing to emphasize the arc is not half the circle)


The answer is
$$c=(2\pi-4\arctan(a/2r))r$$
Here's why: If you connect the center of the circle to the two ends of the baseline, you will have four identical right triangles, each with the same angle at the center. If we call this angle $\theta$, then the leftover angle is $2\pi-4\theta$, so that $c=(2\pi-4\theta)r$. It remains to note that the side opposite $\theta$ has length $a/2$ while the side adjacent has length $r$, so that
$$\tan\theta={a/2\over r}={a\over2r}$$
and thus $\theta=\arctan(a/2r)$.