Copyright | (C) Frank Staals |
---|---|
License | see the LICENSE file |
Maintainer | Frank Staals |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- simplify :: (Ord r, Fractional r, Arity d) => r -> PolyLine d p r -> PolyLine d p r
- simplifyWith :: (LineSegment d p r -> PolyLine d p r -> Bool) -> PolyLine d p r -> PolyLine d p r
Documentation
simplify :: (Ord r, Fractional r, Arity d) => r -> PolyLine d p r -> PolyLine d p r Source #
Line simplification with the Imai-Iri alogrithm. Given a distance value eps and a polyline pl, constructs a simplification of pl (i.e. with vertices from pl) s.t. all other vertices are within dist eps to the original polyline.
Running time: \( O(n^2) \) time.
simplifyWith :: (LineSegment d p r -> PolyLine d p r -> Bool) -> PolyLine d p r -> PolyLine d p r Source #
Given a function that tests if the shortcut is valid, compute a simplification using the Imai-Iri algorithm.
Running time: \( O(Tn^2 \) time, where \(T\) is the time to evaluate the predicate.