# What kind of curve is made of half circles?

I have this curve. It's definitely no sine or cosine. It consists of half circles. How do you call it and how do you describe it mathematically?

• Those don't look like semicircles. Nov 12, 2014 at 20:16
• For an equation of this curve, why not try a fourier series. Link: mathworld.wolfram.com/FourierSeriesSemicircle.html
– Alan
Nov 12, 2014 at 22:19
• Hi Alan ! The so called "Fourier Series Semicircle" from Wolfram is not the function wanted by VoidCatz. This is a series of semicircles with y(x) always positive, instead of the wanted series of semicircles with y(x) alternatively positive and negative. Nov 13, 2014 at 9:26
• It's very doable, I suppose Mathematica would be of some help. y = 1.78073sin(x + pi/2)+ 0.29494sin(3(x + pi/2)) + 0.13274sin(5(x + pi/2)) + .07903sin(7(x+pi/2))
– Alan
Nov 13, 2014 at 18:16
• Mathematica Code: Plot[Pi (BesselJ[1, Pi/2] Sin[x] - (BesselJ[1, (3 Pi)/2] Sin[3 x])/ 3 + (BesselJ[1, (5 Pi)/2] Sin[5 x])/ 5 - (BesselJ[1, (7 Pi)/2] Sin[7 x])/ 7 + (BesselJ[1, (9 Pi)/2] Sin[9 x])/9 ), {x, 0, 10}] has blocks that look like Plot [Sqrt[ (Pi/2)^2 - (x - Pi/2)^2], {x, 0, Pi} ] . One intends to use an iterator, but this answer is computed very quickly in any case and the error is actually not visible .
– Alan
Nov 13, 2014 at 19:58

Let's define a family of functions ($r$ is the radius of a semicircle and $n\in \mathbb {Z}$): $$f_n(x, r)=(-1)^n\sqrt {r^2-(x-nr)^2}$$ Then the function you're looking for is (viewing functions as sets): $$F (x, r)=\bigcup_{n\in \mathbb {Z}} f_n (x, r)$$ I don't know the name for this function and I honestly don't think it has one.

• How else to view functions then sets?Everything is a set :D Nov 12, 2014 at 20:45
• @VanioBegic, if functions (and virtually any other mathematical object) can be viewved as sets, it doesn't mean thay they are sets. Nov 12, 2014 at 20:48

The Fourier series corresponding the curve is on the form : $$y(x)=a_0+\sum_{n=1}^\infty \big(a_n \cos(\frac{n\pi x}{2r})+b_n \sin(\frac{n\pi x}{2r}) \big)$$ with $a_0=0$ and $b_n=0$ $$a_n=\frac{1}{L}\int_{-L}^L f(x) \cos(\frac{n\pi x}{L})dx=\frac{1}{2r}\int_{-2r}^{2r} f(x) \cos(\frac{n\pi x}{2r})dx$$ where $L=2r$ and $f(x)=\sqrt{r^2-x^2}$ in $-r<x<r$ and $f(x)=-\sqrt{r^2-x^2}$ in $-2r<x<-r$ and in $r<x<2r$

The functions are even, which allows the simplification : $$a_n=\frac{1}{2r}4\int_{0}^{r} \sqrt{r^2-x^2} \cos(\frac{n\pi x}{2r})dx=\frac{2r}{n}J_1(\frac{\pi}{2}n)$$ $J_1$ is the Bessel function of the first kind and of order $n$. $$y(x)=2r\sum_{n=1}^\infty \frac{1}{n}J_1(\frac{\pi}{2}n) \cos(\frac{n\pi x}{2 r})$$ This is only for theoretical interest. On the practical viewpoint, drawing the curve from the Fourier series is of no interest at all. The series is far to be quickly convergent and the numerical computation of the Bessel functions would be too much time consuming.

Bruteforced answer (don't take this too seriously)

$$y=\sqrt{1-(x-2n)^2}, \qquad n\in\mathbb{Z} \\ y \ge 0 \quad \text{if} \quad n|2 \\ y \le 0 \quad \text{if} \quad n\not|\ 2$$

Replace $1$ with $r^2$ if you want the semi-circles of arbitrary radius.

30 terms of the series given by Plot[Pi (BesselJ[1, Pi/2] Sin[x] - (BesselJ[1, (3 Pi)/2] Sin[3 x])/ 3 + (BesselJ[1, (5 Pi)/2] Sin[5 x])/ 5 - (BesselJ[1, (7 Pi)/2] Sin[7 x])/ 7 + (BesselJ[1, (9 Pi)/2] Sin[9 x])/9 ), {x, -50, 50}] has blocks that look like semi-circles of the form : Plot [Sqrt[ (Pi/2)^2 - (x - Pi/2)^2], {x, 0,Pi } ] ,

There's one really close to that one, but those aren't really semicircles, it goes like this $$y=\sin(x)+\sin(y)$$ Don't know if it is what you're looking for but I hope it helps.

To avoid convergence issues due to a Fourier Series, you could realize the periodicity using functions like Mod And Floor:

$$\sqrt{1-(((x+1) \bmod 2)-1)^2} \left(1-2 \left\lfloor (\frac{x+1}{2} \bmod 2)\right\rfloor \right)$$

It is not "a" or one smooth curve. It is a wave form of an infinite series of curves with second order discontinuity at $x = (2 k-1) \pi/2$, slope and point continuities are ok. At every point on the x-axis curvature jumps from $-\pi/2 \rightarrow +\pi/2$ then again $-\pi/2 \rightarrow + \pi/2 ..$

We can evaluate coefficients in a Fourier series as for any periodic wave, as smoothness is not required. In electrical engg. applications such waves create infinite current flow at every jump point, so cannot be adopted.

If you want non-infinite slope then they are not full semi-circles.The wave can be defined as a sloping straight line and then as a circle from tangent point..

Integrating an ODE

$$\dfrac {y'' y}{1+ y'^2 }= - 2$$

you get a curve Elastica having proportion 1.2: 1 width/height with better curvature continuity.

Note that a half-circle centered at $x=c$ with radius $r$ is of the form $y = \pm \sqrt{r^2-(x-c)^2}$, where the sign is based on the center of the circle. Now we can use a step function to jump discretely from one half-circle to the next. Let $c = \text{round}(\frac{x}{r})r$ where "round" rounds to the nearest integer (and rounds arbitrarily when its argument is halfway between two integers). Let $s = 1 - 2(c \text{ mod } 2)$, which gives 1 or $-1$, respectively, when $c$ is the center of a circle going above or below the $x$ axis. Then we get the formula for the entire curve $y = s\sqrt{r^2-(x-c)^2}$.