hgeometry-0.8.0.0: Geometric Algorithms, Data structures, and Data types.

Safe HaskellNone
LanguageHaskell2010

Data.Geometry.SubLine

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
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 #

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 Test.QuickCheck.HGeometryInstances

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) Source #

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

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

(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) Source #

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

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 Source #

(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) Source #

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

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 Source #

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]))
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 ': ([] :: [Type])))

subRange :: forall d p s r p s. Lens (SubLine d p s r) (SubLine d p s r) (Interval p s) (Interval p s) Source #

line :: forall d p s r d r. Lens (SubLine d p s r) (SubLine d p s r) (Line d r) (Line d r) Source #

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 #

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 #