Triangle ABC is inscribed in a circle, and G is another point on the same circle. Drop perpendiculars from G to the three sides (extended if needed).
The source code is at github.com/KirillOsenkov/LiveGeometry. It is written in .NET and Avalonia.