wumpus-basic-0.16.0: Basic objects and system code built on Wumpus-Core.

Portability GHC highly unstable Stephen Tetley

Wumpus.Basic.Geometry.Intersection

Description

Intersection of line to line and line to plane.

** - WARNING ** - this uses quite a high tolerance for floating point equality.

Synopsis

# Documentation

data LineSegment u Source

Instances

 Eq u => Eq (LineSegment u) Ord u => Ord (LineSegment u) Show u => Show (LineSegment u)

interLineLine :: Fractional u => (Point2 u, Point2 u) -> (Point2 u, Point2 u) -> Maybe (Point2 u)Source

`interLineLine` : ` line1 * line2 -> Maybe Point `

Find the intersection of two lines, if there is one.

Lines are infinite they are represented by points on them, they are not line segments.

An answer of `Nothing` may indicate wither the lines coincide or the are parallel.

interLinesegLineseg :: (Fractional u, Ord u, FromPtSize u) => LineSegment u -> LineSegment u -> Maybe (Point2 u)Source

`interLinesegLineseg` : ` line_segment1 * line_segment2 -> Maybe Point `

Find the intersection of two line segments, if there is one.

An answer of `Nothing` indicates that the line segments coincide, or that there is no intersection.

interLinesegLine :: (Fractional u, Ord u, FromPtSize u) => LineSegment u -> (Point2 u, Point2 u) -> Maybe (Point2 u)Source

`interLinesegLine` : ` line_segment * line -> Maybe Point `

Find the intersection of a line and a line segment, if there is one.

An answer of `Nothing` indicates that the the line and line segment coincide, or that there is no intersection.

findIntersect :: (Floating u, Real u, Ord u, FromPtSize u) => Point2 u -> Radian -> [LineSegment u] -> Maybe (Point2 u)Source

`findIntersect` :: ` radial_origin * theta * [line_segment] -> Maybe Point `

Find the first intersection of a line through `radial_origin` at angle `theta` and the supplied line segments, if there is one.

makePlane :: Floating u => Point2 u -> Radian -> (Point2 u, Point2 u)Source

`makePlane` : ` point * ang -> Line `

Make an infinite line / plane passing through the supplied with elevation `ang`.

rectangleLineSegments :: Num u => u -> u -> Point2 u -> [LineSegment u]Source

`rectangleLineSegments` : ` half_width * half_height -> [LineSegment] `

Compute the line segments of a rectangle.

polygonLineSegments :: [Point2 u] -> [LineSegment u]Source

`polygonLineSegments` : ` [point] -> [LineSegment] `

Build the line segments of a polygon fome a list of its vertices.