Copyright | (C) Frank Staals |
---|---|
License | see the LICENSE file |
Maintainer | Frank Staals |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- hasIntersections :: (Ord r, Num r) => [LineSegment 2 p r :+ e] -> Bool
- intersections :: forall p r e. (Ord r, Fractional r) => [LineSegment 2 p r :+ e] -> Intersections p r e
- interiorIntersections :: (Ord r, Fractional r) => [LineSegment 2 p r :+ e] -> Intersections p r e
- type Intersections p r e = Map (Point 2 r) (Associated p r e)
- data Associated p r e = Associated {
- _startPointOf :: Set (AroundEnd (LineSegment 2 p r :+ e))
- _endPointOf :: Set (AroundStart (LineSegment 2 p r :+ e))
- _interiorTo :: Set (AroundIntersection (LineSegment 2 p r :+ e))
- data IntersectionPoint p r e = IntersectionPoint {
- _intersectionPoint :: !(Point 2 r)
- _associatedSegs :: !(Associated p r e)
- mkIntersectionPoint :: (Ord r, Fractional r) => Point 2 r -> [LineSegment 2 p r :+ e] -> [LineSegment 2 p r :+ e] -> IntersectionPoint p r e
- hasSelfIntersections :: (Ord r, Fractional r) => Polygon t p r -> Bool
Documentation
hasIntersections :: (Ord r, Num r) => [LineSegment 2 p r :+ e] -> Bool Source #
Tests if there are any intersections.
\(O(n\log n)\)
intersections :: forall p r e. (Ord r, Fractional r) => [LineSegment 2 p r :+ e] -> Intersections p r e Source #
Compute all intersections
\(O((n+k)\log n)\), where \(k\) is the number of intersections.
interiorIntersections :: (Ord r, Fractional r) => [LineSegment 2 p r :+ e] -> Intersections p r e Source #
Computes all intersection points p s.t. p lies in the interior of at least one of the segments.
\(O((n+k)\log n)\), where \(k\) is the number of intersections.
type Intersections p r e = Map (Point 2 r) (Associated p r e) Source #
For each intersection point the segments intersecting there.
data Associated p r e Source #
The line segments that contain a given point p may either have p as the endpoint or have p in their interior.
if somehow the segment is degenerate, and p is both the start and end it is reported only as the start point.
Associated | |
|
Instances
data IntersectionPoint p r e Source #
An intersection point together with all segments intersecting at this point.
IntersectionPoint | |
|
Instances
:: (Ord r, Fractional r) | |
=> Point 2 r | |
-> [LineSegment 2 p r :+ e] | uncategorized |
-> [LineSegment 2 p r :+ e] | segments we know contain p, |
-> IntersectionPoint p r e |
Given a point p, and a bunch of segments that suposedly intersect at p, correctly categorize them.
hasSelfIntersections :: (Ord r, Fractional r) => Polygon t p r -> Bool Source #
Test if the polygon has self intersections.
\(O(n \log n)\)