cosinus

a = 2.18 (slider from 0 to 12.56, step 0.02)
A: (0, 0)
O': (-1, 0)
c = Circle(O', 1)
M = Rotate(A, a, O')
h = Segment(O', M)
alpha = Angle(A, O', M)
f(x) = sin(x)
f1(x) = If[0 ≤ x ≤ a, f]
P: (a, y(M))
B = Point(c)
E = Point(c)
g = Segment(B, E)
i = Segment(P, M)
b = false
p(x) = If[0 ≤ x ≤ (4 * π), cos(x)]