Skip to content

Commit

Permalink
feat: Add ConvexHull() method to clusters.Cluster struct
Browse files Browse the repository at this point in the history
  • Loading branch information
asturm-fe committed Apr 16, 2024
1 parent f8c9f93 commit 351558f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clusters/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ func (c *Cluster) Append(point space.Point) {
c.PointList = append(c.PointList, point)
}

// ConvexHull returns the convex hull of the clusters PointList
func (c *Cluster) ConvexHull() PointList {
return c.PointList.ConvexHull()
}

// Nearest returns the index of the cluster nearest to point
func (c Clusters) Nearest(point space.Point) int {
var ci int
Expand Down

0 comments on commit 351558f

Please sign in to comment.