hgeometry-0.12.0.0: Geometric Algorithms, Data structures, and Data types.
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageHaskell2010

Data.Geometry.HalfLine

Description

 
Synopsis

Documentation

data HalfLine d r Source #

\(d\)-dimensional Half-Lines

Constructors

HalfLine (Point d r) (Vector d r) 

Instances

Instances details
Arity d => Functor (HalfLine d) Source # 
Instance details

Defined in Data.Geometry.HalfLine

Methods

fmap :: (a -> b) -> HalfLine d a -> HalfLine d b #

(<$) :: a -> HalfLine d b -> HalfLine d a #

Arity d => Foldable (HalfLine d) Source # 
Instance details

Defined in Data.Geometry.HalfLine

Methods

fold :: Monoid m => HalfLine d m -> m #

foldMap :: Monoid m => (a -> m) -> HalfLine d a -> m #

foldMap' :: Monoid m => (a -> m) -> HalfLine d a -> m #

foldr :: (a -> b -> b) -> b -> HalfLine d a -> b #

foldr' :: (a -> b -> b) -> b -> HalfLine d a -> b #

foldl :: (b -> a -> b) -> b -> HalfLine d a -> b #

foldl' :: (b -> a -> b) -> b -> HalfLine d a -> b #

foldr1 :: (a -> a -> a) -> HalfLine d a -> a #

foldl1 :: (a -> a -> a) -> HalfLine d a -> a #

toList :: HalfLine d a -> [a] #

null :: HalfLine d a -> Bool #

length :: HalfLine d a -> Int #

elem :: Eq a => a -> HalfLine d a -> Bool #

maximum :: Ord a => HalfLine d a -> a #

minimum :: Ord a => HalfLine d a -> a #

sum :: Num a => HalfLine d a -> a #

product :: Num a => HalfLine d a -> a #

Arity d => Traversable (HalfLine d) Source # 
Instance details

Defined in Data.Geometry.HalfLine

Methods

traverse :: Applicative f => (a -> f b) -> HalfLine d a -> f (HalfLine d b) #

sequenceA :: Applicative f => HalfLine d (f a) -> f (HalfLine d a) #

mapM :: Monad m => (a -> m b) -> HalfLine d a -> m (HalfLine d b) #

sequence :: Monad m => HalfLine d (m a) -> m (HalfLine d a) #

(Eq r, Fractional r, Arity d) => Eq (HalfLine d r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

Methods

(==) :: HalfLine d r -> HalfLine d r -> Bool #

(/=) :: HalfLine d r -> HalfLine d r -> Bool #

(Eq r, Fractional r) => Eq (HalfLine 2 r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

Methods

(==) :: HalfLine 2 r -> HalfLine 2 r -> Bool #

(/=) :: HalfLine 2 r -> HalfLine 2 r -> Bool #

(Show r, Arity d) => Show (HalfLine d r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

Methods

showsPrec :: Int -> HalfLine d r -> ShowS #

show :: HalfLine d r -> String #

showList :: [HalfLine d r] -> ShowS #

Generic (HalfLine d r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

Associated Types

type Rep (HalfLine d r) :: Type -> Type #

Methods

from :: HalfLine d r -> Rep (HalfLine d r) x #

to :: Rep (HalfLine d r) x -> HalfLine d r #

(NFData r, Arity d) => NFData (HalfLine d r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

Methods

rnf :: HalfLine d r -> () #

HasStart (HalfLine d r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

Associated Types

type StartCore (HalfLine d r) Source #

type StartExtra (HalfLine d r) Source #

(Fractional r, Arity d, Arity (d + 1)) => IsTransformable (HalfLine d r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

HasSupportingLine (HalfLine d r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

(Ord r, Fractional r) => IsIntersectableWith (HalfLine 2 r) (Boundary (Rectangle p r)) Source # 
Instance details

Defined in Data.Geometry.HalfLine

Methods

intersect :: HalfLine 2 r -> Boundary (Rectangle p r) -> Intersection (HalfLine 2 r) (Boundary (Rectangle p r)) #

intersects :: HalfLine 2 r -> Boundary (Rectangle p r) -> Bool #

nonEmptyIntersection :: proxy (HalfLine 2 r) -> proxy (Boundary (Rectangle p r)) -> Intersection (HalfLine 2 r) (Boundary (Rectangle p r)) -> Bool #

(Ord r, Fractional r, Arity d) => IsIntersectableWith (Point d r) (HalfLine d r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

Methods

intersect :: Point d r -> HalfLine d r -> Intersection (Point d r) (HalfLine d r) #

intersects :: Point d r -> HalfLine d r -> Bool #

nonEmptyIntersection :: proxy (Point d r) -> proxy (HalfLine d r) -> Intersection (Point d r) (HalfLine d r) -> Bool #

(Ord r, Fractional r) => IsIntersectableWith (HalfLine 2 r) (Rectangle p r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

Methods

intersect :: HalfLine 2 r -> Rectangle p r -> Intersection (HalfLine 2 r) (Rectangle p r) #

intersects :: HalfLine 2 r -> Rectangle p r -> Bool #

nonEmptyIntersection :: proxy (HalfLine 2 r) -> proxy (Rectangle p r) -> Intersection (HalfLine 2 r) (Rectangle p r) -> Bool #

(Ord r, Fractional r) => IsIntersectableWith (HalfLine 2 r) (HalfLine 2 r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

Methods

intersect :: HalfLine 2 r -> HalfLine 2 r -> Intersection (HalfLine 2 r) (HalfLine 2 r) #

intersects :: HalfLine 2 r -> HalfLine 2 r -> Bool #

nonEmptyIntersection :: proxy (HalfLine 2 r) -> proxy (HalfLine 2 r) -> Intersection (HalfLine 2 r) (HalfLine 2 r) -> Bool #

(Ord r, Fractional r) => IsIntersectableWith (HalfLine 2 r) (Line 2 r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

Methods

intersect :: HalfLine 2 r -> Line 2 r -> Intersection (HalfLine 2 r) (Line 2 r) #

intersects :: HalfLine 2 r -> Line 2 r -> Bool #

nonEmptyIntersection :: proxy (HalfLine 2 r) -> proxy (Line 2 r) -> Intersection (HalfLine 2 r) (Line 2 r) -> Bool #

(Ord r, Fractional r) => IsIntersectableWith (LineSegment 2 () r) (HalfLine 2 r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

Methods

intersect :: LineSegment 2 () r -> HalfLine 2 r -> Intersection (LineSegment 2 () r) (HalfLine 2 r) #

intersects :: LineSegment 2 () r -> HalfLine 2 r -> Bool #

nonEmptyIntersection :: proxy (LineSegment 2 () r) -> proxy (HalfLine 2 r) -> Intersection (LineSegment 2 () r) (HalfLine 2 r) -> Bool #

type Rep (HalfLine d r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

type Rep (HalfLine d r) = D1 ('MetaData "HalfLine" "Data.Geometry.HalfLine" "hgeometry-0.12.0.0-3A6BqD11e4bE4Mwo2IplDZ" 'False) (C1 ('MetaCons "HalfLine" 'PrefixI 'True) (S1 ('MetaSel ('Just "_startPoint") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Point d r)) :*: S1 ('MetaSel ('Just "_halfLineDirection") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector d r))))
type NumType (HalfLine d r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

type NumType (HalfLine d r) = r
type Dimension (HalfLine d r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

type Dimension (HalfLine d r) = d
type StartCore (HalfLine d r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

type StartCore (HalfLine d r) = Point d r
type StartExtra (HalfLine d r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

type StartExtra (HalfLine d r) = ()
type IntersectionOf (HalfLine 2 r) (Boundary (Rectangle p r)) Source # 
Instance details

Defined in Data.Geometry.HalfLine

type IntersectionOf (HalfLine 2 r) (Boundary (Rectangle p r)) = '[NoIntersection, Point 2 r, (Point 2 r, Point 2 r), LineSegment 2 () r]
type IntersectionOf (Point d r) (HalfLine d r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

type IntersectionOf (Point d r) (HalfLine d r) = '[NoIntersection, Point d r]
type IntersectionOf (HalfLine d r) (Line d r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

type IntersectionOf (HalfLine d r) (Line d r) = '[NoIntersection, Point d r, HalfLine d r]
type IntersectionOf (HalfLine 2 r) (Rectangle p r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

type IntersectionOf (HalfLine 2 r) (HalfLine 2 r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

type IntersectionOf (HalfLine 2 r) (HalfLine 2 r) = '[NoIntersection, Point 2 r, LineSegment 2 () r, HalfLine 2 r]
type IntersectionOf (LineSegment 2 p r) (HalfLine 2 r) Source # 
Instance details

Defined in Data.Geometry.HalfLine

type IntersectionOf (LineSegment 2 p r) (HalfLine 2 r) = '[NoIntersection, Point 2 r, LineSegment 2 () r]

startPoint :: forall d r. Lens' (HalfLine d r) (Point d r) Source #

halfLineDirection :: forall d r. Lens' (HalfLine d r) (Vector d r) Source #

toHalfLine :: (Num r, Arity d) => LineSegment d p r -> HalfLine d r Source #

Transform a LineSegment into a half-line, by forgetting the second endpoint. Note that this also forgets about if the starting point was open or closed.

halfLineToSubLine :: (Arity d, Num r) => HalfLine d r -> SubLine d () (UnBounded r) r Source #

fromSubLine :: (Num r, Arity d) => SubLine d p (UnBounded r) r -> Maybe (HalfLine d r) Source #