From 351558fb5fb5e25fa368db6a0c695cab94dd5a34 Mon Sep 17 00:00:00 2001 From: sturm19 Date: Tue, 16 Apr 2024 17:29:05 +0200 Subject: [PATCH] feat: Add ConvexHull() method to clusters.Cluster struct --- clusters/cluster.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clusters/cluster.go b/clusters/cluster.go index f0be99e..2202f07 100644 --- a/clusters/cluster.go +++ b/clusters/cluster.go @@ -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