A polygon rolls on a line . The positions of a vertex when has a side flush with form a polygonal path (orange). The orange segments are the base sides of green isosceles triangles. When you drag the "combine" slider, the green triangles combine to form a right triangle with height , the diameter of incircle of the polygon. Hence, the length of the orange path is the sum of the height and the hypotenuse of this triangle.
As the number of sides goes to infinity, the orange path approaches a half cycloid and the hypotenuse of the triangle approaches . Hence the arc length of one arc of the cycloid is .