Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- intersections :: forall r p. (Ord r, Fractional r) => [LineSegment 2 p r] -> Intersections p r
- collect :: (Ord r, Fractional r) => (LineSegment 2 p r, LineSegment 2 p r) -> Intersections p r -> Intersections p r
- handlePoint :: Ord r => LineSegment 2 p r -> LineSegment 2 p r -> Point 2 r -> Intersections p r -> Intersections p r
- addTo :: Ord r => Point 2 r -> LineSegment 2 p r -> Intersections p r -> Intersections p r
- isEndPointOf :: Eq r => Point 2 r -> LineSegment 2 p r -> Bool
- pairs :: [a] -> [(a, a)]
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 #