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

Safe HaskellNone
LanguageHaskell2010

Data.Geometry.SubLine

Synopsis

Documentation

data SubLine d p 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 => Bifunctor (SubLine d) Source # 
Instance details

Defined in Data.Geometry.SubLine

Methods

bimap :: (a -> b) -> (c -> d0) -> SubLine d a c -> SubLine d b d0 #

first :: (a -> b) -> SubLine d a c -> SubLine d b c #

second :: (b -> c) -> SubLine d a b -> SubLine d a c #

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

Defined in Data.Geometry.SubLine

Methods

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

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

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

Defined in Data.Geometry.SubLine

Methods

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

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

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

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

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

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

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

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

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

null :: SubLine d p a -> Bool #

length :: SubLine d p a -> Int #

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

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

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

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

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

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

Defined in Data.Geometry.SubLine

Methods

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

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

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

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

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

Defined in Data.Geometry.SubLine

Methods

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

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

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

Defined in Data.Geometry.SubLine

Methods

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

show :: SubLine d p r -> String #

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

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

Defined in Test.QuickCheck.HGeometryInstances

Methods

arbitrary :: Gen (SubLine d p r) #

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

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

Defined in Data.Geometry.SubLine

Methods

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

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

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

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

Defined in Data.Geometry.Slab

Methods

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

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

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

type NumType (SubLine d p r) Source # 
Instance details

Defined in Data.Geometry.SubLine

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

Defined in Data.Geometry.SubLine

type Dimension (SubLine d p r) = d
type IntersectionOf (SubLine 2 p r) (SubLine 2 q r) Source # 
Instance details

Defined in Data.Geometry.SubLine

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

Defined in Data.Geometry.Slab

type IntersectionOf (SubLine 2 p r) (Slab o a r) = NoIntersection ': (SubLine 2 () r ': ([] :: [*]))

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

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

pointAt :: (Num r, Arity d) => r -> Line d r -> Point d r Source #

Get the point at the given position along line, where 0 corresponds to the anchorPoint of the line, and 1 to the point anchorPoint .+^ directionVector

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

Annotate the subRange with the actual ending points

toOffset :: (Eq r, Fractional r, Arity d) => Point d r -> Line d r -> r Source #

given point p on line (Line q v), Get the scalar lambda s.t. p = q + lambda v

onSubLine :: (Ord r, Fractional r, Arity d) => Point d r -> SubLine d p 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 -> 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

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