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

Algorithms.Geometry.PolyLineSimplification.ImaiIri

Description

 
Synopsis

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.