Drag the 8 ball around the cue ball to aim, and the slider to roll the cue ball further along the dashed path. Every time it hits a cushion it bounces off at the same angle it came in, like light off a mirror.
The source code is at github.com/KirillOsenkov/LiveGeometry. It is written in .NET and Avalonia.