wumpus-drawing-0.9.0: High-level drawing objects built on Wumpus-Basic.

PortabilityGHC
Stabilityhighly unstable
MaintainerStephen Tetley <stephen.tetley@gmail.com>
Safe HaskellSafe-Infered

Wumpus.Drawing.Paths.Intersection

Description

Intersection of Paths with (infinite) lines.

Synopsis

Documentation

data Line u Source

Infinite line represented by two points.

Constructors

Line (Point2 u) (Point2 u) 

Instances

(Ord u, Tolerance u) => Eq (Line u) 
Show u => Show (Line u) 

inclinedLine :: Floating u => Point2 u -> Radian -> Line uSource

inclinedLine : point * ang -> Line

Make an infinite line passing through the supplied point inclined by ang.

vectorLine :: Num u => Vec2 u -> Point2 u -> Line uSource

data Ray u Source

A Ray extends from the first point, through the second to infinity.

(Line extends to infinity in both directions.

Constructors

Ray (Point2 u) (Point2 u) 

Instances

(Ord u, Tolerance u) => Eq (Ray u) 
Show u => Show (Ray u) 

inclinedRay :: Floating u => Point2 u -> Radian -> Ray uSource

Make an infinite ray starting from the supplied point inclined by ang.

lineLineIntersection :: (Fractional u, Ord u, Tolerance u) => Line u -> Line 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 either the lines coincide or the are parallel.

rectangleRadialIntersect :: (Real u, Floating u, InterpretUnit u, Tolerance u) => u -> u -> Radian -> Maybe (Vec2 u)Source

Answer is vector from center.

isoscelesTriangleRadialIntersect :: (Real u, Floating u, InterpretUnit u, Tolerance u) => u -> u -> Radian -> Maybe (Vec2 u)Source

Answer is vector from centroid.