Graham scan algorithm for finding convex hull.

Namespace:  AForge.Math.Geometry
Assembly:  AForge.Math (in AForge.Math.dll) Version: 2.2.5.0 (2.2.5.0)

Syntax

C#
public class GrahamConvexHull : IConvexHullAlgorithm

Remarks

The class implements Graham scan algorithm for finding convex hull of a given set of points.

Sample usage:

CopyC#
// generate some random points
Random rand = new Random( );
List<IntPoint> points = new List<IntPoint>( );

for ( int i = 0; i < 10; i++ )
{
    points.Add( new IntPoint(
           rand.Next( 200 ) - 100,
           rand.Next( 200 ) - 100 ) );
}

// find the convex hull
IConvexHullAlgorithm hullFinder = new GrahamConvexHull( );
List<IntPoint> hull = hullFinder.FindHull( points );

Inheritance Hierarchy

System..::.Object
  AForge.Math.Geometry..::.GrahamConvexHull

See Also