In my opinion, the mechanism would draw a zig-zag line, not a sine (nor cosine) curve,
because the rotating circle is driving the bar at a constant speed, between reversals.
The red drive gear would have to be linked differently, to a point on its circumference, so that the lateral motion is tied to the x? coordinate, to do the trig wave.