A wheel exactly 1 across rolls along a ruler, and its rim is painted: dark blue, light blue, dark blue, then a short red bit. Drag the slider to roll it. Every bit of paint that touches the ruler stays on it, so the painted line on the ruler is exactly as long as the distance around the wheel.
The source code is at github.com/KirillOsenkov/LiveGeometry. It is written in .NET and Avalonia.