Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 609 Bytes

README.md

File metadata and controls

21 lines (14 loc) · 609 Bytes

Convex Hull using Graham's Scan

This package implements Graham's scan in order to find the convex hull of a given set of points in a Euclidean plane.

Usage

Points containing an X and Y coordinate, along with a slice type for Points, are defined as follows:

type Point struct {
	X, Y float64
}

type PointSlice []Point

Graham's scan takes a PointSlice and returns a PointSlice containing the Points contained by the convex hull. Example:

MyConvexHull := convexhull.GrahamScan(MyPointSlice)