Seven rods, pinned together. The two short ones at the left are nailed to the board at their left ends; drag the left nail to move the whole machine. Drag the yellow joint along its arc and watch the green pen: it draws a perfectly straight line, though nothing in the machine moves straight.
The source code is at github.com/KirillOsenkov/LiveGeometry. It is written in .NET and Avalonia.