Diameter of a Point Set

This applet implements an algorithm for finding the diameter of a set of points (shown in green). It involves the Graham Scan method for computing the convex hull. Click the left mouse button to enter a new point to the set. The CH will be computed after 3 different points are entered. Click the right mouse button to start over. The algorithm has the time complexity O(n log(n)).

Note that the diameter of a pointset is not always the diameter of the minimum enclosing disk, which is indicated by the green circle in the applet area.

Source code