A carpenter's square is a tool with a perfect right angle. Slide it so that its two arms always touch two fixed nails.
The source code is at github.com/KirillOsenkov/LiveGeometry. It is written in .NET and Avalonia.