Copyright | (C) Frank Staals |
---|---|
License | see the LICENSE file |
Maintainer | Frank Staals |
Safe Haskell | None |
Language | Haskell2010 |
Naive implementation to compute the smallest enclosing disk of a set of points in \(\mathbb{R}^2\)
Synopsis
- smallestEnclosingDisk :: (Ord r, Fractional r) => [Point 2 r :+ p] -> DiskResult p r
- pairs :: Fractional r => [Point 2 r :+ p] -> [DiskResult p r]
- triplets :: (Ord r, Fractional r) => [Point 2 r :+ p] -> [DiskResult p r]
- disk' :: (Ord r, Fractional r) => (Point 2 r :+ p) -> (Point 2 r :+ p) -> (Point 2 r :+ p) -> Disk () r
- smallestEnclosingDisk' :: (Ord r, Num r) => [Point 2 r :+ p] -> [DiskResult p r] -> DiskResult p r
- enclosesAll :: (Num r, Ord r) => DiskResult p r -> [Point 2 r :+ q] -> Bool
Documentation
smallestEnclosingDisk :: (Ord r, Fractional r) => [Point 2 r :+ p] -> DiskResult p r Source #
Horrible O(n^4) implementation that simply tries all disks, checks if they enclose all points, and takes the largest one. Basically, this is only useful to check correctness of the other algorithm(s)
pairs :: Fractional r => [Point 2 r :+ p] -> [DiskResult p r] Source #
triplets :: (Ord r, Fractional r) => [Point 2 r :+ p] -> [DiskResult p r] Source #
disk' :: (Ord r, Fractional r) => (Point 2 r :+ p) -> (Point 2 r :+ p) -> (Point 2 r :+ p) -> Disk () r Source #
smallestEnclosingDisk' :: (Ord r, Num r) => [Point 2 r :+ p] -> [DiskResult p r] -> DiskResult p r Source #
Given a list of canidate enclosing disks, report the smallest one.
enclosesAll :: (Num r, Ord r) => DiskResult p r -> [Point 2 r :+ q] -> Bool Source #
check if a disk encloses all points