math.geom2d.polygon.convhull
Class GrahamScan2D

java.lang.Object
  extended by math.geom2d.polygon.convhull.GrahamScan2D
All Implemented Interfaces:
ConvexHull2D

public class GrahamScan2D
extends java.lang.Object
implements ConvexHull2D

Computation of the convex hull using Graham scan algorithm. Note that in its current implementation, this algorithms fails when some points are colinear.

Author:
dlegland

Constructor Summary
GrahamScan2D()
          Creates a new Convex hull calculator.
 
Method Summary
 Polygon2D convexHull(java.util.Collection<? extends Point2D> points)
          Computes the convex hull of the given collection of points.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GrahamScan2D

public GrahamScan2D()
Creates a new Convex hull calculator.

Method Detail

convexHull

public Polygon2D convexHull(java.util.Collection<? extends Point2D> points)
Description copied from interface: ConvexHull2D
Computes the convex hull of the given collection of points.

Specified by:
convexHull in interface ConvexHull2D
Parameters:
points - a set of points
Returns:
the convex polygon corresponding to the convex hull