hgeometry-0.14: Geometric Algorithms, Data structures, and Data types.
Safe HaskellNone
LanguageHaskell2010

Algorithms.Geometry.RayShooting.Naive

Synopsis

Documentation

firstHit :: (Fractional r, Ord r) => HalfLine 2 r -> Polygon t p r -> LineSegment 2 p r Source #

pre: halfline should start in the interior

firstHit' :: (Fractional r, Ord r) => HalfLine 2 r -> Polygon t p r -> Maybe (LineSegment 2 p r) Source #

Compute the first edge hit by the ray, if it exists

firstHitSegments :: (Ord r, Fractional r) => HalfLine 2 r -> [LineSegment 2 p r :+ e] -> Maybe (LineSegment 2 p r :+ e) Source #

Compute the first segment hit by the ray, if it exists

intersectionDistance :: forall r p. (Ord r, Fractional r) => Point 2 r -> HalfLine 2 r -> LineSegment 2 p r -> Maybe r Source #

Given q, a ray, and a segment s, computes if the segment intersects the initial, rightward ray starting in q, and if so returns the (squared) distance from q to that point together with the segment.

labelWithDistances :: (Ord r, Fractional r) => Point 2 r -> HalfLine 2 r -> [LineSegment 2 p r :+ b] -> [LineSegment 2 p r :+ (Maybe r, b)] Source #

Labels the segments with the distance from q to their intersection point with the ray.