hgeometry-0.12.0.2: Geometric Algorithms, Data structures, and Data types.
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageHaskell2010

Algorithms.Geometry.Diameter.Naive

Description

 
Synopsis

Documentation

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

Computes the Euclidean diameter by naively trying all pairs.

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

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.

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