hgeometry-kernel
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageGHC2024

HGeometry.HalfSpace

Description

Representing halfspaces

Synopsis

Documentation

boundingHyperPlaneLens :: forall boundingHyperPlane boundingHyperPlane' f. Functor f => (boundingHyperPlane -> f boundingHyperPlane') -> HalfSpaceF boundingHyperPlane -> f (HalfSpaceF boundingHyperPlane') Source #

Lens to access the hyperplane bounding the halfspace

Generally, one can just use boundingHyperPlane from the HalfSpace_ class. But this one is useful if you need a lens to change the type of the bounding hyperplane.

data Sign Source #

The sign of an expression

Constructors

Negative 
Positive 

Instances

Instances details
Bounded Sign Source # 
Instance details

Defined in HGeometry.Sign

Enum Sign Source # 
Instance details

Defined in HGeometry.Sign

Show Sign Source # 
Instance details

Defined in HGeometry.Sign

Eq Sign Source # 
Instance details

Defined in HGeometry.Sign

Methods

(==) :: Sign -> Sign -> Bool Source #

(/=) :: Sign -> Sign -> Bool Source #

Ord Sign Source # 
Instance details

Defined in HGeometry.Sign

type family BoundingHyperPlane halfSpace (d :: Nat) r Source #

Instances

Instances details
type BoundingHyperPlane (HalfSpaceF boundingHyperPlane) d r Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

type BoundingHyperPlane (HalfSpaceF boundingHyperPlane) d r = boundingHyperPlane
type BoundingHyperPlane (core :+ extra) d r Source # 
Instance details

Defined in HGeometry.HalfSpace.Class

type BoundingHyperPlane (core :+ extra) d r = BoundingHyperPlane core d r

type HalfPlane_ halfPlane r = HalfSpace_ halfPlane 2 r Source #

Type synonym for halfplanes in R^2

class (Dimension halfSpace ~ d, Dimension (BoundingHyperPlane halfSpace d r) ~ d, NumType halfSpace ~ r, NumType (BoundingHyperPlane halfSpace d r) ~ r) => HalfSpace_ halfSpace (d :: Nat) r | halfSpace -> d, halfSpace -> r where Source #

Types modelling halfspaces.

Associated Types

type BoundingHyperPlane halfSpace (d :: Nat) r Source #

Methods

boundingHyperPlane :: Lens' halfSpace (BoundingHyperPlane halfSpace d r) Source #

Access the bounding hyperplane

halfSpaceSign :: Lens' halfSpace Sign Source #

Lens to access the sign of the halfspace.

Instances

Instances details
(NumType boundingHyperPlane ~ r, Dimension boundingHyperPlane ~ d) => HalfSpace_ (HalfSpaceF boundingHyperPlane) d r Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Associated Types

type BoundingHyperPlane (HalfSpaceF boundingHyperPlane) d r 
Instance details

Defined in HGeometry.HalfSpace.Type

type BoundingHyperPlane (HalfSpaceF boundingHyperPlane) d r = boundingHyperPlane

Methods

boundingHyperPlane :: Lens' (HalfSpaceF boundingHyperPlane) (BoundingHyperPlane (HalfSpaceF boundingHyperPlane) d r) Source #

halfSpaceSign :: Lens' (HalfSpaceF boundingHyperPlane) Sign Source #

HalfSpace_ core d r => HalfSpace_ (core :+ extra) d r Source # 
Instance details

Defined in HGeometry.HalfSpace.Class

Associated Types

type BoundingHyperPlane (core :+ extra) d r 
Instance details

Defined in HGeometry.HalfSpace.Class

type BoundingHyperPlane (core :+ extra) d r = BoundingHyperPlane core d r

Methods

boundingHyperPlane :: Lens' (core :+ extra) (BoundingHyperPlane (core :+ extra) d r) Source #

halfSpaceSign :: Lens' (core :+ extra) Sign Source #

type HalfPlaneF line = HalfSpaceF line Source #

A Halfplane (which is just a Halfspace in R^2)

type HalfSpace (d :: Natural) r = HalfSpaceF (HyperPlane d r) Source #

Arbitrary halfspaces in r^d.

data HalfSpaceF boundingHyperPlane Source #

A HalfSpace bounded by a hyperplane. The sign indicates which side of the bounding hyperplane is indicated. Iff the sign is positive, we mean the points for which onSideTest returns a positive value.

Half spaces include their bounding hyperplane.

Constructors

HalfSpace !Sign boundingHyperPlane 

Instances

Instances details
Functor HalfSpaceF Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Methods

fmap :: (a -> b) -> HalfSpaceF a -> HalfSpaceF b Source #

(<$) :: a -> HalfSpaceF b -> HalfSpaceF a Source #

Foldable HalfSpaceF Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Methods

fold :: Monoid m => HalfSpaceF m -> m Source #

foldMap :: Monoid m => (a -> m) -> HalfSpaceF a -> m Source #

foldMap' :: Monoid m => (a -> m) -> HalfSpaceF a -> m Source #

foldr :: (a -> b -> b) -> b -> HalfSpaceF a -> b Source #

foldr' :: (a -> b -> b) -> b -> HalfSpaceF a -> b Source #

foldl :: (b -> a -> b) -> b -> HalfSpaceF a -> b Source #

foldl' :: (b -> a -> b) -> b -> HalfSpaceF a -> b Source #

foldr1 :: (a -> a -> a) -> HalfSpaceF a -> a Source #

foldl1 :: (a -> a -> a) -> HalfSpaceF a -> a Source #

toList :: HalfSpaceF a -> [a] Source #

null :: HalfSpaceF a -> Bool Source #

length :: HalfSpaceF a -> Int Source #

elem :: Eq a => a -> HalfSpaceF a -> Bool Source #

maximum :: Ord a => HalfSpaceF a -> a Source #

minimum :: Ord a => HalfSpaceF a -> a Source #

sum :: Num a => HalfSpaceF a -> a Source #

product :: Num a => HalfSpaceF a -> a Source #

Traversable HalfSpaceF Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Methods

traverse :: Applicative f => (a -> f b) -> HalfSpaceF a -> f (HalfSpaceF b) Source #

sequenceA :: Applicative f => HalfSpaceF (f a) -> f (HalfSpaceF a) Source #

mapM :: Monad m => (a -> m b) -> HalfSpaceF a -> m (HalfSpaceF b) Source #

sequence :: Monad m => HalfSpaceF (m a) -> m (HalfSpaceF a) Source #

Show boundingHyperPlane => Show (HalfSpaceF boundingHyperPlane) Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Methods

showsPrec :: Int -> HalfSpaceF boundingHyperPlane -> ShowS Source #

show :: HalfSpaceF boundingHyperPlane -> String Source #

showList :: [HalfSpaceF boundingHyperPlane] -> ShowS Source #

Eq boundingHyperPlane => Eq (HalfSpaceF boundingHyperPlane) Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Methods

(==) :: HalfSpaceF boundingHyperPlane -> HalfSpaceF boundingHyperPlane -> Bool Source #

(/=) :: HalfSpaceF boundingHyperPlane -> HalfSpaceF boundingHyperPlane -> Bool Source #

Ord boundingHyperPlane => Ord (HalfSpaceF boundingHyperPlane) Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Methods

compare :: HalfSpaceF boundingHyperPlane -> HalfSpaceF boundingHyperPlane -> Ordering Source #

(<) :: HalfSpaceF boundingHyperPlane -> HalfSpaceF boundingHyperPlane -> Bool Source #

(<=) :: HalfSpaceF boundingHyperPlane -> HalfSpaceF boundingHyperPlane -> Bool Source #

(>) :: HalfSpaceF boundingHyperPlane -> HalfSpaceF boundingHyperPlane -> Bool Source #

(>=) :: HalfSpaceF boundingHyperPlane -> HalfSpaceF boundingHyperPlane -> Bool Source #

max :: HalfSpaceF boundingHyperPlane -> HalfSpaceF boundingHyperPlane -> HalfSpaceF boundingHyperPlane Source #

min :: HalfSpaceF boundingHyperPlane -> HalfSpaceF boundingHyperPlane -> HalfSpaceF boundingHyperPlane Source #

(HasSquaredEuclideanDistance boundingHyperPlane, HasIntersectionWith (Point d r) (HalfSpaceF boundingHyperPlane), d ~ Dimension boundingHyperPlane, r ~ NumType boundingHyperPlane) => HasSquaredEuclideanDistance (HalfSpaceF boundingHyperPlane) Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Methods

squaredEuclideanDistTo :: forall r0 (d0 :: Nat) point. (r0 ~ NumType (HalfSpaceF boundingHyperPlane), d0 ~ Dimension (HalfSpaceF boundingHyperPlane), Num r0, Point_ point d0 r0) => point -> HalfSpaceF boundingHyperPlane -> r0 Source #

pointClosestTo :: forall r0 (d0 :: Nat) point. (r0 ~ NumType (HalfSpaceF boundingHyperPlane), d0 ~ Dimension (HalfSpaceF boundingHyperPlane), Num r0, Point_ point d0 r0) => point -> HalfSpaceF boundingHyperPlane -> Point d0 r0 Source #

pointClosestToWithDistance :: forall r0 (d0 :: Nat) point. (r0 ~ NumType (HalfSpaceF boundingHyperPlane), d0 ~ Dimension (HalfSpaceF boundingHyperPlane), Num r0, Point_ point d0 r0) => point -> HalfSpaceF boundingHyperPlane -> (Point d0 r0, r0) Source #

(NumType boundingHyperPlane ~ r, Dimension boundingHyperPlane ~ d) => HalfSpace_ (HalfSpaceF boundingHyperPlane) d r Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Associated Types

type BoundingHyperPlane (HalfSpaceF boundingHyperPlane) d r 
Instance details

Defined in HGeometry.HalfSpace.Type

type BoundingHyperPlane (HalfSpaceF boundingHyperPlane) d r = boundingHyperPlane

Methods

boundingHyperPlane :: Lens' (HalfSpaceF boundingHyperPlane) (BoundingHyperPlane (HalfSpaceF boundingHyperPlane) d r) Source #

halfSpaceSign :: Lens' (HalfSpaceF boundingHyperPlane) Sign Source #

(HasIntersectionWith line line', HyperPlane_ line 2 r, HyperPlane_ line' 2 r, Ord r, Fractional r) => HasIntersectionWith (HalfSpaceF line) (HalfSpaceF line') Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Methods

intersects :: HalfSpaceF line -> HalfSpaceF line' -> Bool Source #

(Point_ point d r, Ord r, Num r, HyperPlane_ plane d r) => HasIntersectionWith (ClosedLineSegment point) (HalfSpaceF plane) Source # 
Instance details

Defined in HGeometry.LineSegment.Intersection

Methods

intersects :: ClosedLineSegment point -> HalfSpaceF plane -> Bool Source #

(Point_ point 2 r, Ord r, Fractional r, HyperPlane_ plane 2 r, IsIntersectableWith (LinePV 2 r) plane, Intersection (LinePV 2 r) plane ~ Maybe (LineLineIntersectionG r line')) => IsIntersectableWith (ClosedLineSegment point) (HalfSpaceF plane) Source # 
Instance details

Defined in HGeometry.LineSegment.Intersection

(HyperPlane_ boudingHyperPlane d r, Ord r, Num r, Has_ Additive_ d r) => HasIntersectionWith (Point d r) (HalfSpaceF boudingHyperPlane) Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Methods

intersects :: Point d r -> HalfSpaceF boudingHyperPlane -> Bool Source #

(HyperPlane_ boudingHyperPlane d r, Ord r, Num r, Has_ Additive_ d r) => IsIntersectableWith (Point d r) (HalfSpaceF boudingHyperPlane) Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Methods

intersect :: Point d r -> HalfSpaceF boudingHyperPlane -> Intersection (Point d r) (HalfSpaceF boudingHyperPlane) Source #

type Dimension (HalfSpaceF boundingHyperPlane) Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

type Dimension (HalfSpaceF boundingHyperPlane) = Dimension boundingHyperPlane
type NumType (HalfSpaceF boundingHyperPlane) Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

type NumType (HalfSpaceF boundingHyperPlane) = NumType boundingHyperPlane
type BoundingHyperPlane (HalfSpaceF boundingHyperPlane) d r Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

type BoundingHyperPlane (HalfSpaceF boundingHyperPlane) d r = boundingHyperPlane
type Intersection (ClosedLineSegment point) (HalfSpaceF plane) Source # 
Instance details

Defined in HGeometry.LineSegment.Intersection

type Intersection (Point d r) (HalfSpaceF boudingHyperPlane) Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

type Intersection (Point d r) (HalfSpaceF boudingHyperPlane) = Maybe (Point_x_HalfSpace_Intersection (Point d r) (Point d r))

data Point_x_HalfSpace_Intersection boundaryPoint interiorPoint Source #

Point x HalfSpace intersection

Constructors

Point_x_HalfSpace_OnBoundary boundaryPoint 
Point_x_HalfSpace_Interior interiorPoint 

Instances

Instances details
Bifoldable Point_x_HalfSpace_Intersection Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Methods

bifold :: Monoid m => Point_x_HalfSpace_Intersection m m -> m Source #

bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> Point_x_HalfSpace_Intersection a b -> m Source #

bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> Point_x_HalfSpace_Intersection a b -> c Source #

bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> Point_x_HalfSpace_Intersection a b -> c Source #

Bifoldable1 Point_x_HalfSpace_Intersection Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Methods

bifold1 :: Semigroup m => Point_x_HalfSpace_Intersection m m -> m Source #

bifoldMap1 :: Semigroup m => (a -> m) -> (b -> m) -> Point_x_HalfSpace_Intersection a b -> m Source #

Bifunctor Point_x_HalfSpace_Intersection Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Bitraversable Point_x_HalfSpace_Intersection Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Point_x_HalfSpace_Intersection a b -> f (Point_x_HalfSpace_Intersection c d) Source #

Bitraversable1 Point_x_HalfSpace_Intersection Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Functor (Point_x_HalfSpace_Intersection boundaryPoint) Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Methods

fmap :: (a -> b) -> Point_x_HalfSpace_Intersection boundaryPoint a -> Point_x_HalfSpace_Intersection boundaryPoint b Source #

(<$) :: a -> Point_x_HalfSpace_Intersection boundaryPoint b -> Point_x_HalfSpace_Intersection boundaryPoint a Source #

Foldable (Point_x_HalfSpace_Intersection boundaryPoint) Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Methods

fold :: Monoid m => Point_x_HalfSpace_Intersection boundaryPoint m -> m Source #

foldMap :: Monoid m => (a -> m) -> Point_x_HalfSpace_Intersection boundaryPoint a -> m Source #

foldMap' :: Monoid m => (a -> m) -> Point_x_HalfSpace_Intersection boundaryPoint a -> m Source #

foldr :: (a -> b -> b) -> b -> Point_x_HalfSpace_Intersection boundaryPoint a -> b Source #

foldr' :: (a -> b -> b) -> b -> Point_x_HalfSpace_Intersection boundaryPoint a -> b Source #

foldl :: (b -> a -> b) -> b -> Point_x_HalfSpace_Intersection boundaryPoint a -> b Source #

foldl' :: (b -> a -> b) -> b -> Point_x_HalfSpace_Intersection boundaryPoint a -> b Source #

foldr1 :: (a -> a -> a) -> Point_x_HalfSpace_Intersection boundaryPoint a -> a Source #

foldl1 :: (a -> a -> a) -> Point_x_HalfSpace_Intersection boundaryPoint a -> a Source #

toList :: Point_x_HalfSpace_Intersection boundaryPoint a -> [a] Source #

null :: Point_x_HalfSpace_Intersection boundaryPoint a -> Bool Source #

length :: Point_x_HalfSpace_Intersection boundaryPoint a -> Int Source #

elem :: Eq a => a -> Point_x_HalfSpace_Intersection boundaryPoint a -> Bool Source #

maximum :: Ord a => Point_x_HalfSpace_Intersection boundaryPoint a -> a Source #

minimum :: Ord a => Point_x_HalfSpace_Intersection boundaryPoint a -> a Source #

sum :: Num a => Point_x_HalfSpace_Intersection boundaryPoint a -> a Source #

product :: Num a => Point_x_HalfSpace_Intersection boundaryPoint a -> a Source #

Traversable (Point_x_HalfSpace_Intersection boundaryPoint) Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Methods

traverse :: Applicative f => (a -> f b) -> Point_x_HalfSpace_Intersection boundaryPoint a -> f (Point_x_HalfSpace_Intersection boundaryPoint b) Source #

sequenceA :: Applicative f => Point_x_HalfSpace_Intersection boundaryPoint (f a) -> f (Point_x_HalfSpace_Intersection boundaryPoint a) Source #

mapM :: Monad m => (a -> m b) -> Point_x_HalfSpace_Intersection boundaryPoint a -> m (Point_x_HalfSpace_Intersection boundaryPoint b) Source #

sequence :: Monad m => Point_x_HalfSpace_Intersection boundaryPoint (m a) -> m (Point_x_HalfSpace_Intersection boundaryPoint a) Source #

(Show boundaryPoint, Show interiorPoint) => Show (Point_x_HalfSpace_Intersection boundaryPoint interiorPoint) Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Methods

showsPrec :: Int -> Point_x_HalfSpace_Intersection boundaryPoint interiorPoint -> ShowS Source #

show :: Point_x_HalfSpace_Intersection boundaryPoint interiorPoint -> String Source #

showList :: [Point_x_HalfSpace_Intersection boundaryPoint interiorPoint] -> ShowS Source #

(Eq boundaryPoint, Eq interiorPoint) => Eq (Point_x_HalfSpace_Intersection boundaryPoint interiorPoint) Source # 
Instance details

Defined in HGeometry.HalfSpace.Type

Methods

(==) :: Point_x_HalfSpace_Intersection boundaryPoint interiorPoint -> Point_x_HalfSpace_Intersection boundaryPoint interiorPoint -> Bool Source #

(/=) :: Point_x_HalfSpace_Intersection boundaryPoint interiorPoint -> Point_x_HalfSpace_Intersection boundaryPoint interiorPoint -> Bool Source #