A rhombus is a quadrilateral with four equal sides. Build a square on each side, then connect the centers of the four squares.
The source code is at github.com/KirillOsenkov/LiveGeometry. It is written in .NET and Avalonia.