hgeometry
Safe HaskellNone
LanguageGHC2021

HGeometry.HalfPlane.CommonIntersection

Synopsis

Documentation

data CommonIntersection halfPlane r Source #

Common intersection of a bunch of halfplanes

Constructors

EmptyIntersection 
SingletonPoint (Point 2 r) (Vector 3 halfPlane)

Common intersection is a singleton point, defined by the three given halfplanes

InSubLine (VerticalOrLineEQ r) (Vector 2 halfPlane) (SubLine halfPlane r)

The two halfPlanes that define the line, and the other halfplanes furthe restricitng the line.

Slab halfPlane halfPlane

two parallel halfPlanes l and u that form a slab;

BoundedRegion (ConvexPolygon (Point 2 r :+ halfPlane)) 
UnboundedRegion (Chain Seq halfPlane r)

each vertex stores the interior halfplane of the CCW-edge it is incident to.

Instances

Instances details
(Show r, Show halfPlane) => Show (CommonIntersection halfPlane r) Source # 
Instance details

Defined in HGeometry.HalfPlane.CommonIntersection

Methods

showsPrec :: Int -> CommonIntersection halfPlane r -> ShowS #

show :: CommonIntersection halfPlane r -> String #

showList :: [CommonIntersection halfPlane r] -> ShowS #

(Eq r, Eq halfPlane) => Eq (CommonIntersection halfPlane r) Source # 
Instance details

Defined in HGeometry.HalfPlane.CommonIntersection

Methods

(==) :: CommonIntersection halfPlane r -> CommonIntersection halfPlane r -> Bool #

(/=) :: CommonIntersection halfPlane r -> CommonIntersection halfPlane r -> Bool #

data SubLine halfPlane r Source #

Part of the line

Constructors

EntireLine 
InHalfLine (HalfLine (Point 2 r)) halfPlane

the third halfPlane

InSegment (ClosedLineSegment (Point 2 r)) halfPlane halfPlane

the remaining two halfplanes

Instances

Instances details
(Show r, Show halfPlane) => Show (SubLine halfPlane r) Source # 
Instance details

Defined in HGeometry.HalfPlane.CommonIntersection

Methods

showsPrec :: Int -> SubLine halfPlane r -> ShowS #

show :: SubLine halfPlane r -> String #

showList :: [SubLine halfPlane r] -> ShowS #

(Eq r, Eq halfPlane) => Eq (SubLine halfPlane r) Source # 
Instance details

Defined in HGeometry.HalfPlane.CommonIntersection

Methods

(==) :: SubLine halfPlane r -> SubLine halfPlane r -> Bool #

(/=) :: SubLine halfPlane r -> SubLine halfPlane r -> Bool #

newtype Chain (f :: Type -> Type) halfPlane r Source #

A polygonal chain bounding an unbounded convex region, in CCW order.

Constructors

Chain (Alternating f (Point 2 r) halfPlane) 

Instances

Instances details
Functor f => Bifunctor (Chain f) Source # 
Instance details

Defined in HGeometry.HalfPlane.CommonIntersection.Chain

Methods

bimap :: (a -> b) -> (c -> d) -> Chain f a c -> Chain f b d #

first :: (a -> b) -> Chain f a c -> Chain f b c #

second :: (b -> c) -> Chain f a b -> Chain f a c #

Functor f => Functor (Chain f r) Source # 
Instance details

Defined in HGeometry.HalfPlane.CommonIntersection.Chain

Methods

fmap :: (a -> b) -> Chain f r a -> Chain f r b #

(<$) :: a -> Chain f r b -> Chain f r a #

(Show halfPlane, Show (f (Point 2 r, halfPlane))) => Show (Chain f halfPlane r) Source # 
Instance details

Defined in HGeometry.HalfPlane.CommonIntersection.Chain

Methods

showsPrec :: Int -> Chain f halfPlane r -> ShowS #

show :: Chain f halfPlane r -> String #

showList :: [Chain f halfPlane r] -> ShowS #

(Eq halfPlane, Eq (f (Point 2 r, halfPlane))) => Eq (Chain f halfPlane r) Source # 
Instance details

Defined in HGeometry.HalfPlane.CommonIntersection.Chain

Methods

(==) :: Chain f halfPlane r -> Chain f halfPlane r -> Bool #

(/=) :: Chain f halfPlane r -> Chain f halfPlane r -> Bool #

(Ord halfPlane, Ord (f (Point 2 r, halfPlane))) => Ord (Chain f halfPlane r) Source # 
Instance details

Defined in HGeometry.HalfPlane.CommonIntersection.Chain

Methods

compare :: Chain f halfPlane r -> Chain f halfPlane r -> Ordering #

(<) :: Chain f halfPlane r -> Chain f halfPlane r -> Bool #

(<=) :: Chain f halfPlane r -> Chain f halfPlane r -> Bool #

(>) :: Chain f halfPlane r -> Chain f halfPlane r -> Bool #

(>=) :: Chain f halfPlane r -> Chain f halfPlane r -> Bool #

max :: Chain f halfPlane r -> Chain f halfPlane r -> Chain f halfPlane r #

min :: Chain f halfPlane r -> Chain f halfPlane r -> Chain f halfPlane r #

commonIntersection :: (Foldable1 f, Functor f, HalfPlane_ halfPlane r, Fractional r, Ord r, Show halfPlane, Show r) => f halfPlane -> CommonIntersection halfPlane r Source #

Computes the common intersection of a \(n\) halfplanes.

running time: \(O(n\log n)\)