src/main/java/de/javagl/geom/ConvexHull.java
/**
     * Compute the list of points that form the convex hull of the given
     * input points. If there are less than 4 input points, a list 
     * containing the input points will be returned (regardless of
     * whether these points are degenerate, i.e. even when they are
     * on one line or at the same location)
     * 
     * @param inputPoints The input points
     * @return The convex hull points
     */
Compute the list of points that form the convex hull of the given
input points. If there are less than 4 input points, a list
containing the input points will be returned (regardless of
whether these points are degenerate, i.e. even when they are
on one line or at the same location)

@param inputPoints The input points
@return The convex hull points
Compute the list of points that form the convex hull of the given input points . If there are less than 4 input points a list containing the input points will be returned ( regardless of whether these points are degenerate i . e . even when they are on one line or at the same location ) @param inputPoints The input points @return The convex hull points
public static List<Point2D> compute(List<? extends Point2D> inputPoints)
    {
        if (inputPoints.size() <= 3)
        {
            return new ArrayList<Point2D>(inputPoints);
        }
        List<Point2D> points = new ArrayList<Point2D>(inputPoints);
        Point2D referencePoint = Collections.min(points, Points.YX_COMPARATOR);
        Comparator<Point2D> byAngleComparator = 
            Points.byAngleComparator(referencePoint);
        Comparator<Point2D> comparator = 
            composeComparators(byAngleComparator, Points.YX_COMPARATOR);
        Collections.sort(points, comparator);
        List<Point2D> newPoints = makeAnglesUnique(points);
        List<Point2D> result = scan(newPoints);
        return result;
    }
public static List < Point2D > compute ( List < ? extends Point2D > inputPoints ) { if ( inputPoints . size ( ) <= 3 ) { return new ArrayList < Point2D > ( inputPoints ) ; } List < Point2D > points = new ArrayList < Point2D > ( inputPoints ) ; Point2D referencePoint = Collections . min ( points , Points . YX_COMPARATOR ) ; Comparator < Point2D > byAngleComparator = Points . byAngleComparator ( referencePoint ) ; Comparator < Point2D > comparator = composeComparators ( byAngleComparator , Points . YX_COMPARATOR ) ; Collections . sort ( points , comparator ) ; List < Point2D > newPoints = makeAnglesUnique ( points ) ; List < Point2D > result = scan ( newPoints ) ; return result ; }
Compute the list of points that form the convex hull of the given
 input points.
Compute the list of points that form the convex hull of the given input points .
// Compute the reference point, using a YX_COMPARATOR: It sorts points 
 // by their y-coordinate. If two points have the same y-coordinate, 
 // it sorts them by the x-coordinate.
 // Sort the points. The primary sorting criterion is the angle that
 // the line from the reference point to the point has to the x-axis. 
 // The secondary sorting criterion will be the YX_COMPARATOR.
