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

Safe HaskellNone
LanguageHaskell2010

Algorithms.Geometry.Diameter

Synopsis

Documentation

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

diametralPairNaive :: (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)\)

diametralPairWithNaive :: 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.

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