Abraham Gadalla tried (but failed) to post the following question. Why does the red point not continue to follow the square (and the curve) for the full range $0\le x\le 2\pi$?
Manipulate[
With[{q = Quotient[x, Pi/2], m = Mod[x, Pi/2]},
Graphics[
{EdgeForm[Black], LightGray, Rotate[{Rectangle[{q, 0}],
{Red, PointSize[0.03], Point[{q, q}]}}, -m, {q + 1, 0}],
{Thick, Red, Circle[{1, 0}, 1, {Pi, Pi/2}],
Circle[{2, 0}, Sqrt[2], {3 Pi/4, Pi/4}],Circle[{3, 0}, 1, {Pi/2, 0}]}
}
]
], {x, 0, 2 Pi}]
What simple modification is required to get this to work?