hgeometry-0.11.0.0: Geometric Algorithms, Data structures, and Data types.

Algorithms.Geometry.Diameter.Naive

diameter :: (Ord r, Floating r, Arity d) => [Point d r :+ p] -> r Source #

diametralPair :: (Ord r, Num r, Arity d) => [Point d r :+ p] -> Maybe (Point d r :+ p, Point d r :+ p) Source #

Computes the Euclidean diametral pair by naively trying all pairs.

running time: \(O(n^2)\)

diametralPairWith :: Ord r => (Point d r -> Point d r -> r) -> [Point d r :+ p] -> Maybe (Point d r :+ p, Point d r :+ p) Source #

Given a distance function and a list of points pts, computes the diametral pair by naively trying all pairs.