Drag the slider to turn the yellow gear. Its teeth push the green gear the other way, and the green gear pushes the purple one back the first way: every gear in a chain turns against its neighbors.
The source code is at github.com/KirillOsenkov/LiveGeometry. It is written in .NET and Avalonia.