Safe Haskell | None |
---|---|
Language | Haskell2010 |
- douglasPeucker :: (Ord r, Fractional r, Arity d) => r -> PolyLine d p r -> PolyLine d p r
- merge :: PolyLine d p r -> PolyLine d p r -> PolyLine d p r
- split :: Int -> PolyLine d p r -> (PolyLine d p r, PolyLine d p r)
- maxDist :: (Ord r, Fractional r, Arity d) => Seq2 (Point d r :+ p) -> LineSegment d p r -> (Int, r)
Documentation
douglasPeucker :: (Ord r, Fractional r, Arity d) => r -> PolyLine d p r -> PolyLine d p r Source #
Line simplification with the well-known Douglas Peucker alogrithm. Given a distance value eps adn 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) worst case, O(n log n) expected.
Internal functions
merge :: PolyLine d p r -> PolyLine d p r -> PolyLine d p r Source #
Concatenate the two polylines, dropping their shared vertex