-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Geometric predicates -- -- Exact computation of common geometric predicates. @package GeomPredicates @version 0.1 module Numeric.Geometric.Primitives type Vector2 a = (a, a) type LineSegment a = (a, a) lOrigin :: LineSegment a -> a lDestination :: LineSegment a -> a flipLine :: LineSegment a -> LineSegment a data IntersectionPoint Endpoint0 :: IntersectionPoint Endpoint1 :: IntersectionPoint Between :: IntersectionPoint type IntersectionPair = (IntersectionPoint, IntersectionPoint) data LineIntersection Coincident :: LineIntersection Parallel :: LineIntersection -- | Not intersecting and not parallel NINP :: LineIntersection Intersecting :: IntersectionPair -> LineIntersection data Slope ZeroSlope :: Slope UndefinedSlope :: Slope NegativeSlope :: Slope PositiveSlope :: Slope instance Eq Slope instance Read Slope instance Show Slope instance Eq LineIntersection instance Show LineIntersection instance Read LineIntersection instance Eq IntersectionPoint instance Read IntersectionPoint instance Show IntersectionPoint instance Enum IntersectionPoint module Numeric.Geometric.Predicates.Rational -- | Counter-clockwise orientation test. Classifies p3 in relation to the -- line formed by p1 and p2. ccw :: Vector2 Rational -> Vector2 Rational -> Vector2 Rational -> Ordering -- | Test the relation of a point to the circle formed by (p1..p3). incircle :: (Vector2 Rational, Vector2 Rational, Vector2 Rational) -> Vector2 Rational -> Ordering -- | Test if Point is within the closed interval specified cintt :: Rational -> Rational -> Rational -> Bool -- | Calculate the point of intersecton. Assumes the input lines are -- already known to be intersecting, isctp :: LineSegment (Vector2 Rational) -> LineSegment (Vector2 Rational) -> Vector2 Rational