Usage: The animation draws a line that connects two nearest points. Click the left mouse button to add a point at the mouse point and the right button to remove a point at the mouse point.

The figure illustrates an interactive showing the formation of a line segment from two points out of a set of random points.