I am looking for a closed-form formula for something like this:

Can anybody help - Thank you!
|
I am looking for a closed-form formula for something like this:
Can anybody help - Thank you! |
|||||||||||||
|
|
This works (for circles of radius $r$): $$f(x)=(-1)^{\displaystyle\left\lfloor \frac{x}{2r}+\frac{1}{2}\right\rfloor}\sqrt{r^2-\left(x-2r\left\lfloor\frac{x}{2r}+\frac{1}{2}\right\rfloor\right)^2}$$ Image for $r=1$:
Mathematica code:
|
|||||||||||
|