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

Data.Geometry.SubLine

Description

SubLine; a part of a line

Synopsis

Documentation

data SubLine d p s r Source #

Part of a line. The interval is ranged based on the vector of the line l, and s.t.t zero is the anchorPoint of l.

Constructors

SubLine 

Fields

Instances

Instances details
Arity d => Functor (SubLine d p s) Source # 
Instance details

Defined in Data.Geometry.SubLine

Methods

fmap :: (a -> b) -> SubLine d p s a -> SubLine d p s b #

(<$) :: a -> SubLine d p s b -> SubLine d p s a #

Arity d => Foldable (SubLine d p s) Source # 
Instance details

Defined in Data.Geometry.SubLine

Methods

fold :: Monoid m => SubLine d p s m -> m #

foldMap :: Monoid m => (a -> m) -> SubLine d p s a -> m #

foldMap' :: Monoid m => (a -> m) -> SubLine d p s a -> m #

foldr :: (a -> b -> b) -> b -> SubLine d p s a -> b #

foldr' :: (a -> b -> b) -> b -> SubLine d p s a -> b #

foldl :: (b -> a -> b) -> b -> SubLine d p s a -> b #

foldl' :: (b -> a -> b) -> b -> SubLine d p s a -> b #

foldr1 :: (a -> a -> a) -> SubLine d p s a -> a #

foldl1 :: (a -> a -> a) -> SubLine d p s a -> a #

toList :: SubLine d p s a -> [a] #

null :: SubLine d p s a -> Bool #

length :: SubLine d p s a -> Int #

elem :: Eq a => a -> SubLine d p s a -> Bool #

maximum :: Ord a => SubLine d p s a -> a #

minimum :: Ord a => SubLine d p s a -> a #

sum :: Num a => SubLine d p s a -> a #

product :: Num a => SubLine d p s a -> a #

Arity d => Traversable (SubLine d p s) Source # 
Instance details

Defined in Data.Geometry.SubLine

Methods

traverse :: Applicative f => (a -> f b) -> SubLine d p s a -> f (SubLine d p s b) #

sequenceA :: Applicative f => SubLine d p s (f a) -> f (SubLine d p s a) #

mapM :: Monad m => (a -> m b) -> SubLine d p s a -> m (SubLine d p s b) #

sequence :: Monad m => SubLine d p s (m a) -> m (SubLine d p s a) #

(Eq r, Eq s, Fractional r, Eq p, Arity d) => Eq (SubLine d p s r) Source # 
Instance details

Defined in Data.Geometry.SubLine

Methods

(==) :: SubLine d p s r -> SubLine d p s r -> Bool #

(/=) :: SubLine d p s r -> SubLine d p s r -> Bool #

(Show r, Show s, Show p, Arity d) => Show (SubLine d p s r) Source # 
Instance details

Defined in Data.Geometry.SubLine

Methods

showsPrec :: Int -> SubLine d p s r -> ShowS #

show :: SubLine d p s r -> String #

showList :: [SubLine d p s r] -> ShowS #

(Arbitrary r, Arbitrary p, Arbitrary s, Arity d, Ord r, Ord s, Ord p, Num r) => Arbitrary (SubLine d p s r) Source # 
Instance details

Defined in Data.Geometry.SubLine

Methods

arbitrary :: Gen (SubLine d p s r) #

shrink :: SubLine d p s r -> [SubLine d p s r] #

(Fractional r, Ord r, HasBoundingLines o) => IsIntersectableWith (SubLine 2 a r r) (Slab o a r) Source # 
Instance details

Defined in Data.Geometry.Slab

Methods

intersect :: SubLine 2 a r r -> Slab o a r -> Intersection (SubLine 2 a r r) (Slab o a r) #

intersects :: SubLine 2 a r r -> Slab o a r -> Bool #

nonEmptyIntersection :: proxy (SubLine 2 a r r) -> proxy (Slab o a r) -> Intersection (SubLine 2 a r r) (Slab o a r) -> Bool #

(Ord r, Fractional r) => IsIntersectableWith (SubLine 2 p (UnBounded r) r) (SubLine 2 p (UnBounded r) r) Source # 
Instance details

Defined in Data.Geometry.SubLine

Methods

intersect :: SubLine 2 p (UnBounded r) r -> SubLine 2 p (UnBounded r) r -> Intersection (SubLine 2 p (UnBounded r) r) (SubLine 2 p (UnBounded r) r) #

intersects :: SubLine 2 p (UnBounded r) r -> SubLine 2 p (UnBounded r) r -> Bool #

nonEmptyIntersection :: proxy (SubLine 2 p (UnBounded r) r) -> proxy (SubLine 2 p (UnBounded r) r) -> Intersection (SubLine 2 p (UnBounded r) r) (SubLine 2 p (UnBounded r) r) -> Bool #

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

Defined in Data.Geometry.SubLine

Methods

intersect :: SubLine 2 p r r -> SubLine 2 p r r -> Intersection (SubLine 2 p r r) (SubLine 2 p r r) #

intersects :: SubLine 2 p r r -> SubLine 2 p r r -> Bool #

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

type Dimension (SubLine d p s r) Source # 
Instance details

Defined in Data.Geometry.SubLine

type Dimension (SubLine d p s r) = d
type IntersectionOf (SubLine 2 p s r) (Slab o a r) Source # 
Instance details

Defined in Data.Geometry.Slab

type IntersectionOf (SubLine 2 p s r) (Slab o a r) = '[NoIntersection, SubLine 2 () s r]
type IntersectionOf (SubLine 2 p s r) (SubLine 2 q s r) Source # 
Instance details

Defined in Data.Geometry.SubLine

type IntersectionOf (SubLine 2 p s r) (SubLine 2 q s r) = '[NoIntersection, Point 2 r, SubLine 2 p s r]

line :: Lens (SubLine d1 p s r1) (SubLine d2 p s r2) (Line d1 r1) (Line d2 r2) Source #

Line part of SubLine.

subRange :: Lens (SubLine d p1 s1 r) (SubLine d p2 s2 r) (Interval p1 s1) (Interval p2 s2) Source #

Interval part of SubLine.

fixEndPoints :: (Num r, Arity d) => SubLine d p r r -> SubLine d (Point d r :+ p) r r Source #

Annotate the subRange with the actual ending points

dropExtra :: SubLine d p s r -> SubLine d () s r Source #

forget the extra information stored at the endpoints of the subline.

_unBounded :: Prism' (SubLine d p (UnBounded r) r) (SubLine d p r r) Source #

Prism for downcasting an unbounded subline to a subline.

toUnbounded :: SubLine d p r r -> SubLine d p (UnBounded r) r Source #

Transform into an subline with a potentially unbounded interval

fromUnbounded :: SubLine d p (UnBounded r) r -> Maybe (SubLine d p r r) Source #

Try to make a potentially unbounded subline into a bounded one.

onSubLine :: (Ord r, Fractional r, Arity d) => Point d r -> SubLine d p r r -> Bool Source #

given point p, and a Subline l r such that p lies on line l, test if it lies on the subline, i.e. in the interval r

onSubLineUB :: (Ord r, Fractional r) => Point 2 r -> SubLine 2 p (UnBounded r) r -> Bool Source #

given point p, and a Subline l r such that p lies on line l, test if it lies on the subline, i.e. in the interval r

onSubLine2 :: (Ord r, Num r) => Point 2 r -> SubLine 2 p r r -> Bool Source #

given point p, and a Subline l r such that p lies on line l, test if it lies on the subline, i.e. in the interval r

onSubLine2UB :: (Ord r, Fractional r) => Point 2 r -> SubLine 2 p (UnBounded r) r -> Bool Source #

given point p, and a Subline l r such that p lies on line l, test if it lies on the subline, i.e. in the interval r

getEndPointsUnBounded :: (Num r, Arity d) => SubLine d p (UnBounded r) r -> Interval p (UnBounded (Point d r)) Source #

Get the endpoints of an unbounded interval

fromLine :: Arity d => Line d r -> SubLine d () (UnBounded r) r Source #

Create a SubLine that covers the original line from -infinity to +infinity.