hgeometry-0.11.0.0: Geometric Algorithms, Data structures, and Data types.

Safe HaskellNone
LanguageHaskell2010

Algorithms.Geometry.LineSegmentIntersection.Naive

Synopsis

Documentation

intersections :: forall r p. (Ord r, Fractional r) => [LineSegment 2 p r] -> Intersections p r Source #

Compute all intersections (naively)

\(O(n^2)\)

collect :: (Ord r, Fractional r) => (LineSegment 2 p r, LineSegment 2 p r) -> Intersections p r -> Intersections p r Source #

Test if the two segments intersect, and if so add the segment to the map

handlePoint :: Ord r => LineSegment 2 p r -> LineSegment 2 p r -> Point 2 r -> Intersections p r -> Intersections p r Source #

Add s and s' to the map with key p

addTo :: Ord r => Point 2 r -> LineSegment 2 p r -> Intersections p r -> Intersections p r Source #

figure out which map to add the point to

isEndPointOf :: Eq r => Point 2 r -> LineSegment 2 p r -> Bool Source #

pairs :: [a] -> [(a, a)] Source #