| Copyright | (C) Frank Staals |
|---|---|
| License | see the LICENSE file |
| Maintainer | Frank Staals |
| Safe Haskell | None |
| Language | GHC2024 |
HGeometry.LineSegment
Description
Line segment data type and some basic functions on line segments
Synopsis
- data LineSegment (endPoint :: Type -> Type) point where
- pattern LineSegment :: endPoint point -> endPoint point -> LineSegment endPoint point
- pattern ClosedLineSegment :: point -> point -> ClosedLineSegment point
- pattern OpenLineSegment :: point -> point -> OpenLineSegment point
- type ClosedLineSegment point = LineSegment (EndPoint 'Closed) point
- type OpenLineSegment point = LineSegment (EndPoint 'Open) point
- asALineSegment :: LineSegment_ segment point => segment -> LineSegment AnEndPoint point
- newtype EndPoint (et :: EndPointType) r where
- data AnEndPoint r where
- AnEndPoint !EndPointType !r
- pattern AnOpenE :: r -> AnEndPoint r
- pattern AnClosedE :: r -> AnEndPoint r
- module HGeometry.LineSegment.Class
- spanIn :: forall point (d :: Nat) r (endPoint :: Type -> Type). (Point_ point d r, Ord r, IxValue (endPoint point) ~ point, EndPoint_ (endPoint point)) => Getter point r -> LineSegment endPoint point -> Interval AnEndPoint r
- class IsEndPoint endPoint endPoint => EndPoint_ endPoint where
- endPointType :: endPoint -> EndPointType
- mkEndPoint :: IxValue endPoint -> endPoint
- data LineLineSegmentIntersection lineSegment
- = Line_x_LineSegment_Point (Point 2 (NumType lineSegment))
- | Line_x_LineSegment_LineSegment lineSegment
- data LineSegmentLineSegmentIntersection lineSegment
- = LineSegment_x_LineSegment_Point (Point 2 (NumType lineSegment))
- | LineSegment_x_LineSegment_LineSegment lineSegment
- data HalfLineLineSegmentIntersection point segment
- = HalfLine_x_LineSegment_Point point
- | HalfLine_x_LineSegment_LineSegment segment
- data ClosedSegmentHalfSpaceIntersection extra point
- compareColinearInterval :: forall r point (endPoint :: Type -> Type). (Ord r, Num r, Point_ point 2 r, IxValue (endPoint point) ~ point, EndPoint_ (endPoint point)) => LinePV 2 r -> LineSegment endPoint point -> CompareInterval
Documentation
data LineSegment (endPoint :: Type -> Type) point where Source #
Data type representing intervals
Bundled Patterns
| pattern LineSegment :: endPoint point -> endPoint point -> LineSegment endPoint point | Construct a line Segment |
| pattern ClosedLineSegment :: point -> point -> ClosedLineSegment point | Construct a closed interval |
| pattern OpenLineSegment :: point -> point -> OpenLineSegment point | Construct an open ended interval |
Instances
type ClosedLineSegment point = LineSegment (EndPoint 'Closed) point Source #
A type representing Closed LineSegments
type OpenLineSegment point = LineSegment (EndPoint 'Open) point Source #
A type representing Open LineSegments
asALineSegment :: LineSegment_ segment point => segment -> LineSegment AnEndPoint point Source #
convert into an LineSegment whose endpoints are explicitly tagged.
newtype EndPoint (et :: EndPointType) r Source #
EndPoint with a type safe tag
Constructors
| EndPoint r |
Bundled Patterns
| pattern OpenE :: r -> EndPoint 'Open r | Constructs an Open endpoint |
| pattern ClosedE :: r -> EndPoint 'Closed r | Constructs a closed endpoint |
Instances
| Foldable1 (EndPoint et) Source # | |||||
Defined in HGeometry.Interval.EndPoint Methods fold1 :: Semigroup m => EndPoint et m -> m Source # foldMap1 :: Semigroup m => (a -> m) -> EndPoint et a -> m Source # foldMap1' :: Semigroup m => (a -> m) -> EndPoint et a -> m Source # toNonEmpty :: EndPoint et a -> NonEmpty a Source # maximum :: Ord a => EndPoint et a -> a Source # minimum :: Ord a => EndPoint et a -> a Source # head :: EndPoint et a -> a Source # last :: EndPoint et a -> a Source # foldrMap1 :: (a -> b) -> (a -> b -> b) -> EndPoint et a -> b Source # foldlMap1' :: (a -> b) -> (b -> a -> b) -> EndPoint et a -> b Source # foldlMap1 :: (a -> b) -> (b -> a -> b) -> EndPoint et a -> b Source # foldrMap1' :: (a -> b) -> (a -> b -> b) -> EndPoint et a -> b Source # | |||||
| Functor (EndPoint et) Source # | |||||
| Foldable (EndPoint et) Source # | |||||
Defined in HGeometry.Interval.EndPoint Methods fold :: Monoid m => EndPoint et m -> m Source # foldMap :: Monoid m => (a -> m) -> EndPoint et a -> m Source # foldMap' :: Monoid m => (a -> m) -> EndPoint et a -> m Source # foldr :: (a -> b -> b) -> b -> EndPoint et a -> b Source # foldr' :: (a -> b -> b) -> b -> EndPoint et a -> b Source # foldl :: (b -> a -> b) -> b -> EndPoint et a -> b Source # foldl' :: (b -> a -> b) -> b -> EndPoint et a -> b Source # foldr1 :: (a -> a -> a) -> EndPoint et a -> a Source # foldl1 :: (a -> a -> a) -> EndPoint et a -> a Source # toList :: EndPoint et a -> [a] Source # null :: EndPoint et a -> Bool Source # length :: EndPoint et a -> Int Source # elem :: Eq a => a -> EndPoint et a -> Bool Source # maximum :: Ord a => EndPoint et a -> a Source # minimum :: Ord a => EndPoint et a -> a Source # | |||||
| Traversable (EndPoint et) Source # | |||||
Defined in HGeometry.Interval.EndPoint Methods traverse :: Applicative f => (a -> f b) -> EndPoint et a -> f (EndPoint et b) Source # sequenceA :: Applicative f => EndPoint et (f a) -> f (EndPoint et a) Source # mapM :: Monad m => (a -> m b) -> EndPoint et a -> m (EndPoint et b) Source # sequence :: Monad m => EndPoint et (m a) -> m (EndPoint et a) Source # | |||||
| Read point => Read (ClosedLineSegment point) Source # | |||||
Defined in HGeometry.LineSegment.Internal Methods readsPrec :: Int -> ReadS (ClosedLineSegment point) Source # readList :: ReadS [ClosedLineSegment point] Source # readPrec :: ReadPrec (ClosedLineSegment point) Source # readListPrec :: ReadPrec [ClosedLineSegment point] Source # | |||||
| Show point => Show (ClosedLineSegment point) Source # | |||||
Defined in HGeometry.LineSegment.Internal | |||||
| (Fractional r, Ord r, HasSquaredEuclideanDistance point, Point_ point d r) => HasSquaredEuclideanDistance (ClosedLineSegment point) Source # | |||||
Defined in HGeometry.LineSegment.Internal Methods squaredEuclideanDistTo :: forall r0 (d0 :: Nat) point0. (r0 ~ NumType (ClosedLineSegment point), d0 ~ Dimension (ClosedLineSegment point), Num r0, Point_ point0 d0 r0) => point0 -> ClosedLineSegment point -> r0 Source # pointClosestTo :: forall r0 (d0 :: Nat) point0. (r0 ~ NumType (ClosedLineSegment point), d0 ~ Dimension (ClosedLineSegment point), Num r0, Point_ point0 d0 r0) => point0 -> ClosedLineSegment point -> Point d0 r0 Source # pointClosestToWithDistance :: forall r0 (d0 :: Nat) point0. (r0 ~ NumType (ClosedLineSegment point), d0 ~ Dimension (ClosedLineSegment point), Num r0, Point_ point0 d0 r0) => point0 -> ClosedLineSegment point -> (Point d0 r0, r0) Source # | |||||
| Traversable1 (EndPoint et) Source # | |||||
| ClosedInterval_ (ClosedInterval r) r Source # | |||||
Defined in HGeometry.Interval.Internal | |||||
| ConstructableClosedInterval_ (ClosedInterval r) r Source # | |||||
Defined in HGeometry.Interval.Internal Methods mkClosedInterval :: r -> r -> ClosedInterval r Source # buildClosedInterval :: r -> r -> ClosedInterval r Source # | |||||
| ConstructableOpenInterval_ (OpenInterval r) r Source # | |||||
Defined in HGeometry.Interval.Internal Methods mkOpenInterval :: r -> r -> OpenInterval r Source # | |||||
| OpenInterval_ (OpenInterval r) r Source # | |||||
Defined in HGeometry.Interval.Internal | |||||
| Point_ point (Dimension point) (NumType point) => ClosedLineSegment_ (ClosedLineSegment point) point Source # | |||||
Defined in HGeometry.LineSegment.Internal | |||||
| (Point_ point d r, Fractional r) => HasOnSegment (ClosedLineSegment point) d Source # | |||||
Defined in HGeometry.LineSegment.Internal Methods onSegment :: (Ord r0, Point_ point0 d r0, r0 ~ NumType (ClosedLineSegment point), d ~ Dimension (ClosedLineSegment point)) => point0 -> ClosedLineSegment point -> Bool Source # | |||||
| (Point_ point 2 r, Num r) => HasOnSegment (ClosedLineSegment point) 2 Source # | |||||
Defined in HGeometry.LineSegment.Internal Methods onSegment :: (Ord r0, Point_ point0 2 r0, r0 ~ NumType (ClosedLineSegment point), 2 ~ Dimension (ClosedLineSegment point)) => point0 -> ClosedLineSegment point -> Bool Source # | |||||
| (Point_ point d r, Fractional r) => HasOnSegment (OpenLineSegment point) d Source # | |||||
Defined in HGeometry.LineSegment.Internal Methods onSegment :: (Ord r0, Point_ point0 d r0, r0 ~ NumType (OpenLineSegment point), d ~ Dimension (OpenLineSegment point)) => point0 -> OpenLineSegment point -> Bool Source # | |||||
| (Point_ point 2 r, Num r) => HasOnSegment (OpenLineSegment point) 2 Source # | |||||
Defined in HGeometry.LineSegment.Internal Methods onSegment :: (Ord r0, Point_ point0 2 r0, r0 ~ NumType (OpenLineSegment point), 2 ~ Dimension (OpenLineSegment point)) => point0 -> OpenLineSegment point -> Bool Source # | |||||
| Point_ point (Dimension point) (NumType point) => OpenLineSegment_ (OpenLineSegment point) point Source # | |||||
Defined in HGeometry.LineSegment.Internal | |||||
| Ord r => HasIntersectionWith (ClosedInterval r) (HalfOpenInterval r) Source # | |||||
Defined in HGeometry.Interval.HalfOpen Methods intersects :: ClosedInterval r -> HalfOpenInterval r -> Bool Source # | |||||
| Ord r => HasIntersectionWith (OpenInterval r) (ClosedInterval r) Source # | |||||
Defined in HGeometry.Interval.Internal Methods intersects :: OpenInterval r -> ClosedInterval r -> Bool Source # | |||||
| Ord r => HasIntersectionWith (OpenInterval r) (OpenInterval r) Source # | |||||
Defined in HGeometry.Interval.Internal Methods intersects :: OpenInterval r -> OpenInterval r -> Bool Source # | |||||
| (Point_ point d r, Ord r, Num r, HyperPlane_ plane d r) => HasIntersectionWith (ClosedLineSegment point) (HalfSpaceF plane) Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods intersects :: ClosedLineSegment point -> HalfSpaceF plane -> Bool Source # | |||||
| (Point_ point 2 r, Point_ point' 2 r, Num r, Ord r) => HasIntersectionWith (ClosedLineSegment point) (OpenLineSegment point') Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods intersects :: ClosedLineSegment point -> OpenLineSegment point' -> Bool Source # | |||||
| (Point_ point 2 r, Point_ vertex 2 r, Num r, Ord r) => HasIntersectionWith (ClosedLineSegment point) (Triangle vertex) Source # | Testing for intersections between closed line segments and triangles | ||||
Defined in HGeometry.Triangle Methods intersects :: ClosedLineSegment point -> Triangle vertex -> Bool Source # | |||||
| (Point_ point d r, Point_ point' d r, Ord r, Fractional r, Has_ Metric_ d r, HasSquaredEuclideanDistance point', MkHyperPlaneConstraints d r) => HasIntersectionWith (ClosedLineSegment point') (Ball point) Source # | |||||
Defined in HGeometry.Ball.CenterAndRadius Methods intersects :: ClosedLineSegment point' -> Ball point -> Bool Source # | |||||
| (Point_ point d r, Point_ point' d r, Ord r, Fractional r, Has_ Metric_ d r, HasSquaredEuclideanDistance point') => HasIntersectionWith (ClosedLineSegment point') (Sphere point) Source # | |||||
Defined in HGeometry.Ball.CenterAndRadius Methods intersects :: ClosedLineSegment point' -> Sphere point -> Bool Source # | |||||
| (Point_ point 2 r, Point_ point' 2 r, Num r, Ord r) => HasIntersectionWith (OpenLineSegment point) (ClosedLineSegment point') Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods intersects :: OpenLineSegment point -> ClosedLineSegment point' -> Bool Source # | |||||
| Ord r => IsIntersectableWith (ClosedInterval r) (ClosedInterval r) Source # | |||||
Defined in HGeometry.Interval.Internal Methods intersect :: ClosedInterval r -> ClosedInterval r -> Intersection (ClosedInterval r) (ClosedInterval r) Source # | |||||
| Ord r => IsIntersectableWith (OpenInterval r) (OpenInterval r) Source # | |||||
Defined in HGeometry.Interval.Internal Methods intersect :: OpenInterval r -> OpenInterval r -> Intersection (OpenInterval r) (OpenInterval r) Source # | |||||
| (Point_ point 2 r, Fractional r, Ord r) => IsIntersectableWith (LineEQ r) (ClosedLineSegment point) Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods intersect :: LineEQ r -> ClosedLineSegment point -> Intersection (LineEQ r) (ClosedLineSegment point) Source # | |||||
| (Point_ point 2 r, Fractional r, Ord r) => IsIntersectableWith (LineEQ r) (OpenLineSegment point) Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods intersect :: LineEQ r -> OpenLineSegment point -> Intersection (LineEQ r) (OpenLineSegment point) 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 # | |||||
Defined in HGeometry.LineSegment.Intersection Methods intersect :: ClosedLineSegment point -> HalfSpaceF plane -> Intersection (ClosedLineSegment point) (HalfSpaceF plane) Source # | |||||
| (Point_ point 2 r, Point_ point' 2 r, Num r, Ord r) => HasIntersectionWith (ClosedLineSegment point) (LineSegment AnEndPoint point') Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods intersects :: ClosedLineSegment point -> LineSegment AnEndPoint point' -> Bool Source # | |||||
| (Point_ point 2 r, Point_ point' 2 r, Num r, Ord r) => HasIntersectionWith (OpenLineSegment point) (LineSegment AnEndPoint point') Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods intersects :: OpenLineSegment point -> LineSegment AnEndPoint point' -> Bool Source # | |||||
| HasEndPoint (HalfOpenInterval r) (EndPoint 'Closed r) Source # | |||||
Defined in HGeometry.Interval.HalfOpen | |||||
| HasStartPoint (HalfOpenInterval r) (EndPoint 'Open r) Source # | |||||
Defined in HGeometry.Interval.HalfOpen Methods startPoint :: Lens' (HalfOpenInterval r) (EndPoint 'Open r) Source # | |||||
| (Ord r, IxValue (endPoint r) ~ r, EndPoint_ (endPoint r)) => HasIntersectionWith (ClosedInterval r) (Interval endPoint r) Source # | |||||
Defined in HGeometry.Interval.Internal Methods intersects :: ClosedInterval r -> Interval endPoint r -> Bool Source # | |||||
| Ord r => HasIntersectionWith (OpenInterval r) (Interval AnEndPoint r) Source # | |||||
Defined in HGeometry.Interval.Internal Methods intersects :: OpenInterval r -> Interval AnEndPoint r -> Bool Source # | |||||
| NFData r => NFData (EndPoint et r) Source # | |||||
Defined in HGeometry.Interval.EndPoint | |||||
| Generic (EndPoint et r) Source # | |||||
Defined in HGeometry.Interval.EndPoint Associated Types
| |||||
| Read r => Read (EndPoint 'Closed r) Source # | |||||
| Read r => Read (EndPoint 'Open r) Source # | |||||
| Show r => Show (EndPoint 'Closed r) Source # | |||||
| Show r => Show (EndPoint 'Open r) Source # | |||||
| Eq r => Eq (EndPoint et r) Source # | |||||
| Ord r => Ord (EndPoint et r) Source # | |||||
Defined in HGeometry.Interval.EndPoint Methods compare :: EndPoint et r -> EndPoint et r -> Ordering Source # (<) :: EndPoint et r -> EndPoint et r -> Bool Source # (<=) :: EndPoint et r -> EndPoint et r -> Bool Source # (>) :: EndPoint et r -> EndPoint et r -> Bool Source # (>=) :: EndPoint et r -> EndPoint et r -> Bool Source # max :: EndPoint et r -> EndPoint et r -> EndPoint et r Source # min :: EndPoint et r -> EndPoint et r -> EndPoint et r Source # | |||||
| EndPoint_ (EndPoint 'Closed r) Source # | |||||
Defined in HGeometry.Interval.EndPoint Methods endPointType :: EndPoint 'Closed r -> EndPointType Source # mkEndPoint :: IxValue (EndPoint 'Closed r) -> EndPoint 'Closed r Source # | |||||
| EndPoint_ (EndPoint 'Open r) Source # | |||||
Defined in HGeometry.Interval.EndPoint Methods endPointType :: EndPoint 'Open r -> EndPointType Source # mkEndPoint :: IxValue (EndPoint 'Open r) -> EndPoint 'Open r Source # | |||||
| (Point_ point 2 r, Point_ point' 2 r, Num r, Ord r) => HasIntersectionWith (LineSegment AnEndPoint point) (ClosedLineSegment point') Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods intersects :: LineSegment AnEndPoint point -> ClosedLineSegment point' -> Bool Source # | |||||
| (Point_ point 2 r, Point_ point' 2 r, Num r, Ord r) => HasIntersectionWith (LineSegment AnEndPoint point) (OpenLineSegment point') Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods intersects :: LineSegment AnEndPoint point -> OpenLineSegment point' -> Bool Source # | |||||
| Ord r => HasIntersectionWith (Point 1 r) (ClosedInterval r) Source # | |||||
Defined in HGeometry.Interval.Internal Methods intersects :: Point 1 r -> ClosedInterval r -> Bool Source # | |||||
| Ord r => HasIntersectionWith (Point 1 r) (OpenInterval r) Source # | |||||
Defined in HGeometry.Interval.Internal Methods intersects :: Point 1 r -> OpenInterval r -> Bool Source # | |||||
| (Point_ point 2 r, Fractional r, Ord r) => IsIntersectableWith (LinePV 2 r) (ClosedLineSegment point) Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods intersect :: LinePV 2 r -> ClosedLineSegment point -> Intersection (LinePV 2 r) (ClosedLineSegment point) Source # | |||||
| (Point_ point 2 r, Fractional r, Ord r) => IsIntersectableWith (LinePV 2 r) (OpenLineSegment point) Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods intersect :: LinePV 2 r -> OpenLineSegment point -> Intersection (LinePV 2 r) (OpenLineSegment point) Source # | |||||
| Ord r => IsIntersectableWith (Point 1 r) (ClosedInterval r) Source # | |||||
Defined in HGeometry.Interval.Internal Methods intersect :: Point 1 r -> ClosedInterval r -> Intersection (Point 1 r) (ClosedInterval r) Source # | |||||
| Ord r => IsIntersectableWith (Point 1 r) (OpenInterval r) Source # | |||||
Defined in HGeometry.Interval.Internal Methods intersect :: Point 1 r -> OpenInterval r -> Intersection (Point 1 r) (OpenInterval r) Source # | |||||
| IsEndPoint (EndPoint et r) (EndPoint et r') Source # | Class for types that have | ||||
| Ord r => HasIntersectionWith (Interval AnEndPoint r) (ClosedInterval r) Source # | |||||
Defined in HGeometry.Interval.Internal Methods intersects :: Interval AnEndPoint r -> ClosedInterval r -> Bool Source # | |||||
| Ord r => HasIntersectionWith (Interval AnEndPoint r) (OpenInterval r) Source # | |||||
Defined in HGeometry.Interval.Internal Methods intersects :: Interval AnEndPoint r -> OpenInterval r -> Bool Source # | |||||
| type Intersection (ClosedLineSegment point) (HalfSpaceF plane) Source # | |||||
Defined in HGeometry.LineSegment.Intersection type Intersection (ClosedLineSegment point) (HalfSpaceF plane) = Maybe (ClosedSegmentHalfSpaceIntersection (CanonicalPoint point) point) | |||||
| type Intersection (ClosedLineSegment point') (Ball point) Source # | |||||
Defined in HGeometry.Ball.CenterAndRadius type Intersection (ClosedLineSegment point') (Ball point) = Maybe (IntersectionOf (LinePV (Dimension point) (NumType point)) (Ball point)) | |||||
| type Intersection (LineEQ r) (LineSegment (EndPoint t) point) Source # | |||||
Defined in HGeometry.LineSegment.Intersection | |||||
| type Rep (EndPoint et r) Source # | |||||
Defined in HGeometry.Interval.EndPoint | |||||
| type NumType (EndPoint et r) Source # | |||||
Defined in HGeometry.Interval.EndPoint | |||||
| type IxValue (EndPoint et r) Source # | |||||
Defined in HGeometry.Interval.EndPoint | |||||
| type Intersection (LinePV 2 r) (LineSegment (EndPoint t) point) Source # | |||||
Defined in HGeometry.LineSegment.Intersection | |||||
| type Intersection (LineSegment (EndPoint t) point) (LineSegment (EndPoint t) point) Source # | |||||
Defined in HGeometry.LineSegment.Intersection type Intersection (LineSegment (EndPoint t) point) (LineSegment (EndPoint t) point) = Maybe (LineSegmentLineSegmentIntersection (LineSegment (EndPoint t) point)) | |||||
data AnEndPoint r Source #
Data type modelling an endpoint that can both be open and closed.
Constructors
| AnEndPoint !EndPointType !r |
Bundled Patterns
| pattern AnOpenE :: r -> AnEndPoint r | Constructs an Open endpoint |
| pattern AnClosedE :: r -> AnEndPoint r | Constructs a closed endpoint |
Instances
| Foldable1 AnEndPoint Source # | |||||
Defined in HGeometry.Interval.EndPoint Methods fold1 :: Semigroup m => AnEndPoint m -> m Source # foldMap1 :: Semigroup m => (a -> m) -> AnEndPoint a -> m Source # foldMap1' :: Semigroup m => (a -> m) -> AnEndPoint a -> m Source # toNonEmpty :: AnEndPoint a -> NonEmpty a Source # maximum :: Ord a => AnEndPoint a -> a Source # minimum :: Ord a => AnEndPoint a -> a Source # head :: AnEndPoint a -> a Source # last :: AnEndPoint a -> a Source # foldrMap1 :: (a -> b) -> (a -> b -> b) -> AnEndPoint a -> b Source # foldlMap1' :: (a -> b) -> (b -> a -> b) -> AnEndPoint a -> b Source # foldlMap1 :: (a -> b) -> (b -> a -> b) -> AnEndPoint a -> b Source # foldrMap1' :: (a -> b) -> (a -> b -> b) -> AnEndPoint a -> b Source # | |||||
| Functor AnEndPoint Source # | |||||
Defined in HGeometry.Interval.EndPoint Methods fmap :: (a -> b) -> AnEndPoint a -> AnEndPoint b Source # (<$) :: a -> AnEndPoint b -> AnEndPoint a Source # | |||||
| Foldable AnEndPoint Source # | |||||
Defined in HGeometry.Interval.EndPoint Methods fold :: Monoid m => AnEndPoint m -> m Source # foldMap :: Monoid m => (a -> m) -> AnEndPoint a -> m Source # foldMap' :: Monoid m => (a -> m) -> AnEndPoint a -> m Source # foldr :: (a -> b -> b) -> b -> AnEndPoint a -> b Source # foldr' :: (a -> b -> b) -> b -> AnEndPoint a -> b Source # foldl :: (b -> a -> b) -> b -> AnEndPoint a -> b Source # foldl' :: (b -> a -> b) -> b -> AnEndPoint a -> b Source # foldr1 :: (a -> a -> a) -> AnEndPoint a -> a Source # foldl1 :: (a -> a -> a) -> AnEndPoint a -> a Source # toList :: AnEndPoint a -> [a] Source # null :: AnEndPoint a -> Bool Source # length :: AnEndPoint a -> Int Source # elem :: Eq a => a -> AnEndPoint a -> Bool Source # maximum :: Ord a => AnEndPoint a -> a Source # minimum :: Ord a => AnEndPoint a -> a Source # sum :: Num a => AnEndPoint a -> a Source # product :: Num a => AnEndPoint a -> a Source # | |||||
| Traversable AnEndPoint Source # | |||||
Defined in HGeometry.Interval.EndPoint Methods traverse :: Applicative f => (a -> f b) -> AnEndPoint a -> f (AnEndPoint b) Source # sequenceA :: Applicative f => AnEndPoint (f a) -> f (AnEndPoint a) Source # mapM :: Monad m => (a -> m b) -> AnEndPoint a -> m (AnEndPoint b) Source # sequence :: Monad m => AnEndPoint (m a) -> m (AnEndPoint a) Source # | |||||
| Traversable1 AnEndPoint Source # | |||||
Defined in HGeometry.Interval.EndPoint Methods traverse1 :: Apply f => (a -> f b) -> AnEndPoint a -> f (AnEndPoint b) Source # sequence1 :: Apply f => AnEndPoint (f b) -> f (AnEndPoint b) Source # | |||||
| Generic (AnEndPoint r) Source # | |||||
Defined in HGeometry.Interval.EndPoint Associated Types
Methods from :: AnEndPoint r -> Rep (AnEndPoint r) x Source # to :: Rep (AnEndPoint r) x -> AnEndPoint r Source # | |||||
| Read r => Read (AnEndPoint r) Source # | |||||
Defined in HGeometry.Interval.EndPoint Methods readsPrec :: Int -> ReadS (AnEndPoint r) Source # readList :: ReadS [AnEndPoint r] Source # readPrec :: ReadPrec (AnEndPoint r) Source # readListPrec :: ReadPrec [AnEndPoint r] Source # | |||||
| Show r => Show (AnEndPoint r) Source # | |||||
Defined in HGeometry.Interval.EndPoint | |||||
| Eq r => Eq (AnEndPoint r) Source # | |||||
Defined in HGeometry.Interval.EndPoint Methods (==) :: AnEndPoint r -> AnEndPoint r -> Bool Source # (/=) :: AnEndPoint r -> AnEndPoint r -> Bool Source # | |||||
| Ord r => Ord (AnEndPoint r) Source # | |||||
Defined in HGeometry.Interval.EndPoint Methods compare :: AnEndPoint r -> AnEndPoint r -> Ordering Source # (<) :: AnEndPoint r -> AnEndPoint r -> Bool Source # (<=) :: AnEndPoint r -> AnEndPoint r -> Bool Source # (>) :: AnEndPoint r -> AnEndPoint r -> Bool Source # (>=) :: AnEndPoint r -> AnEndPoint r -> Bool Source # max :: AnEndPoint r -> AnEndPoint r -> AnEndPoint r Source # min :: AnEndPoint r -> AnEndPoint r -> AnEndPoint r Source # | |||||
| EndPoint_ (AnEndPoint r) Source # | |||||
Defined in HGeometry.Interval.EndPoint Methods endPointType :: AnEndPoint r -> EndPointType Source # mkEndPoint :: IxValue (AnEndPoint r) -> AnEndPoint r Source # | |||||
| IsEndPoint (AnEndPoint r) (AnEndPoint r') Source # | |||||
Defined in HGeometry.Interval.EndPoint Methods _endPoint :: Lens (AnEndPoint r) (AnEndPoint r') (IxValue (AnEndPoint r)) (IxValue (AnEndPoint r')) Source # | |||||
| (Point_ point 2 r, Point_ point' 2 r, Num r, Ord r) => HasIntersectionWith (ClosedLineSegment point) (LineSegment AnEndPoint point') Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods intersects :: ClosedLineSegment point -> LineSegment AnEndPoint point' -> Bool Source # | |||||
| (Point_ point 2 r, Point_ point' 2 r, Num r, Ord r) => HasIntersectionWith (OpenLineSegment point) (LineSegment AnEndPoint point') Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods intersects :: OpenLineSegment point -> LineSegment AnEndPoint point' -> Bool Source # | |||||
| (Point_ point 2 r, Fractional r, Ord r) => IsIntersectableWith (LineEQ r) (LineSegment AnEndPoint point) Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods intersect :: LineEQ r -> LineSegment AnEndPoint point -> Intersection (LineEQ r) (LineSegment AnEndPoint point) Source # | |||||
| Ord r => HasIntersectionWith (OpenInterval r) (Interval AnEndPoint r) Source # | |||||
Defined in HGeometry.Interval.Internal Methods intersects :: OpenInterval r -> Interval AnEndPoint r -> Bool Source # | |||||
| (Point_ point d r, Fractional r) => HasOnSegment (LineSegment AnEndPoint point) d Source # | |||||
Defined in HGeometry.LineSegment.Internal Methods onSegment :: (Ord r0, Point_ point0 d r0, r0 ~ NumType (LineSegment AnEndPoint point), d ~ Dimension (LineSegment AnEndPoint point)) => point0 -> LineSegment AnEndPoint point -> Bool Source # | |||||
| (Point_ point 2 r, Num r) => HasOnSegment (LineSegment AnEndPoint point) 2 Source # | |||||
Defined in HGeometry.LineSegment.Internal Methods onSegment :: (Ord r0, Point_ point0 2 r0, r0 ~ NumType (LineSegment AnEndPoint point), 2 ~ Dimension (LineSegment AnEndPoint point)) => point0 -> LineSegment AnEndPoint point -> Bool Source # | |||||
| (Point_ point 2 r, Point_ point' 2 r, Num r, Ord r) => HasIntersectionWith (LineSegment AnEndPoint point) (ClosedLineSegment point') Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods intersects :: LineSegment AnEndPoint point -> ClosedLineSegment point' -> Bool Source # | |||||
| (Point_ point 2 r, Point_ point' 2 r, Num r, Ord r) => HasIntersectionWith (LineSegment AnEndPoint point) (OpenLineSegment point') Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods intersects :: LineSegment AnEndPoint point -> OpenLineSegment point' -> Bool Source # | |||||
| (Point_ point 2 r, Fractional r, Ord r) => IsIntersectableWith (LinePV 2 r) (LineSegment AnEndPoint point) Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods intersect :: LinePV 2 r -> LineSegment AnEndPoint point -> Intersection (LinePV 2 r) (LineSegment AnEndPoint point) Source # | |||||
| Ord r => HasIntersectionWith (Point 1 r) (Interval AnEndPoint r) Source # | |||||
Defined in HGeometry.Interval.Internal Methods intersects :: Point 1 r -> Interval AnEndPoint r -> Bool Source # | |||||
| Ord r => IsIntersectableWith (Point 1 r) (Interval AnEndPoint r) Source # | |||||
Defined in HGeometry.Interval.Internal Methods intersect :: Point 1 r -> Interval AnEndPoint r -> Intersection (Point 1 r) (Interval AnEndPoint r) Source # | |||||
| Ord r => HasIntersectionWith (Interval AnEndPoint r) (ClosedInterval r) Source # | |||||
Defined in HGeometry.Interval.Internal Methods intersects :: Interval AnEndPoint r -> ClosedInterval r -> Bool Source # | |||||
| Ord r => HasIntersectionWith (Interval AnEndPoint r) (OpenInterval r) Source # | |||||
Defined in HGeometry.Interval.Internal Methods intersects :: Interval AnEndPoint r -> OpenInterval r -> Bool Source # | |||||
| Ord r => HasIntersectionWith (Interval AnEndPoint r) (Interval AnEndPoint r) Source # | |||||
Defined in HGeometry.Interval.Internal Methods intersects :: Interval AnEndPoint r -> Interval AnEndPoint r -> Bool Source # | |||||
| Ord r => IsIntersectableWith (Interval AnEndPoint r) (Interval AnEndPoint r) Source # | |||||
Defined in HGeometry.Interval.Internal Methods intersect :: Interval AnEndPoint r -> Interval AnEndPoint r -> Intersection (Interval AnEndPoint r) (Interval AnEndPoint r) Source # | |||||
| type Rep (AnEndPoint r) Source # | |||||
Defined in HGeometry.Interval.EndPoint type Rep (AnEndPoint r) = D1 ('MetaData "AnEndPoint" "HGeometry.Interval.EndPoint" "hgeometry-kernel-1.0.0.0-inplace" 'False) (C1 ('MetaCons "AnEndPoint" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'SourceUnpack 'SourceStrict 'DecidedStrict) (Rec0 EndPointType) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 r))) | |||||
| type NumType (AnEndPoint r) Source # | |||||
Defined in HGeometry.Interval.EndPoint | |||||
| type IxValue (AnEndPoint r) Source # | |||||
Defined in HGeometry.Interval.EndPoint | |||||
| type Intersection (LineEQ r) (LineSegment AnEndPoint point) Source # | |||||
Defined in HGeometry.LineSegment.Intersection | |||||
| type Intersection (LinePV 2 r) (LineSegment AnEndPoint point) Source # | |||||
Defined in HGeometry.LineSegment.Intersection | |||||
| type Intersection (LineSegment AnEndPoint point) (LineSegment AnEndPoint point) Source # | |||||
Defined in HGeometry.LineSegment.Intersection type Intersection (LineSegment AnEndPoint point) (LineSegment AnEndPoint point) = Maybe (LineSegmentLineSegmentIntersection (LineSegment AnEndPoint point)) | |||||
module HGeometry.LineSegment.Class
spanIn :: forall point (d :: Nat) r (endPoint :: Type -> Type). (Point_ point d r, Ord r, IxValue (endPoint point) ~ point, EndPoint_ (endPoint point)) => Getter point r -> LineSegment endPoint point -> Interval AnEndPoint r Source #
Computes the span of the interval in the given direction. Note that the returned interval is a proper interval, i.e. with the start smaller than the end.
>>>spanIn xCoord (ClosedLineSegment (Point2 5 (10 :: Int)) (Point2 20 0))Interval (AnEndPoint Closed 5) (AnEndPoint Closed 20)>>>spanIn yCoord (ClosedLineSegment (Point2 5 (10 :: Int)) (Point2 20 0))Interval (AnEndPoint Closed 0) (AnEndPoint Closed 10)
class IsEndPoint endPoint endPoint => EndPoint_ endPoint where Source #
An endpoint storing values of some type r
Methods
endPointType :: endPoint -> EndPointType Source #
Report the type of the endpoint
mkEndPoint :: IxValue endPoint -> endPoint Source #
constructs a "default" enpoint
Instances
| EndPoint_ (AnEndPoint r) Source # | |
Defined in HGeometry.Interval.EndPoint Methods endPointType :: AnEndPoint r -> EndPointType Source # mkEndPoint :: IxValue (AnEndPoint r) -> AnEndPoint r Source # | |
| EndPoint_ (EndPoint 'Closed r) Source # | |
Defined in HGeometry.Interval.EndPoint Methods endPointType :: EndPoint 'Closed r -> EndPointType Source # mkEndPoint :: IxValue (EndPoint 'Closed r) -> EndPoint 'Closed r Source # | |
| EndPoint_ (EndPoint 'Open r) Source # | |
Defined in HGeometry.Interval.EndPoint Methods endPointType :: EndPoint 'Open r -> EndPointType Source # mkEndPoint :: IxValue (EndPoint 'Open r) -> EndPoint 'Open r Source # | |
data LineLineSegmentIntersection lineSegment Source #
Line x LineSegment intersection
Constructors
| Line_x_LineSegment_Point (Point 2 (NumType lineSegment)) | |
| Line_x_LineSegment_LineSegment lineSegment |
Instances
| (Show (Point 2 (NumType lineSegment)), Show lineSegment) => Show (LineLineSegmentIntersection lineSegment) Source # | |
Defined in HGeometry.LineSegment.Intersection | |
| (Eq (Point 2 (NumType lineSegment)), Eq lineSegment) => Eq (LineLineSegmentIntersection lineSegment) Source # | |
Defined in HGeometry.LineSegment.Intersection Methods (==) :: LineLineSegmentIntersection lineSegment -> LineLineSegmentIntersection lineSegment -> Bool Source # (/=) :: LineLineSegmentIntersection lineSegment -> LineLineSegmentIntersection lineSegment -> Bool Source # | |
data LineSegmentLineSegmentIntersection lineSegment Source #
LineSegment x LineSegment intersection
Constructors
| LineSegment_x_LineSegment_Point (Point 2 (NumType lineSegment)) | |
| LineSegment_x_LineSegment_LineSegment lineSegment |
Instances
| (Show (Point 2 (NumType lineSegment)), Show lineSegment) => Show (LineSegmentLineSegmentIntersection lineSegment) Source # | |
Defined in HGeometry.LineSegment.Intersection | |
| (Eq (Point 2 (NumType lineSegment)), Eq lineSegment) => Eq (LineSegmentLineSegmentIntersection lineSegment) Source # | |
Defined in HGeometry.LineSegment.Intersection Methods (==) :: LineSegmentLineSegmentIntersection lineSegment -> LineSegmentLineSegmentIntersection lineSegment -> Bool Source # (/=) :: LineSegmentLineSegmentIntersection lineSegment -> LineSegmentLineSegmentIntersection lineSegment -> Bool Source # | |
data HalfLineLineSegmentIntersection point segment Source #
Data type representing the intersection of a HalfLine and a LineSegment
Constructors
| HalfLine_x_LineSegment_Point point | |
| HalfLine_x_LineSegment_LineSegment segment |
Instances
| Functor (HalfLineLineSegmentIntersection point) Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods fmap :: (a -> b) -> HalfLineLineSegmentIntersection point a -> HalfLineLineSegmentIntersection point b Source # (<$) :: a -> HalfLineLineSegmentIntersection point b -> HalfLineLineSegmentIntersection point a Source # | |||||
| Generic (HalfLineLineSegmentIntersection point segment) Source # | |||||
Defined in HGeometry.LineSegment.Intersection Associated Types
Methods from :: HalfLineLineSegmentIntersection point segment -> Rep (HalfLineLineSegmentIntersection point segment) x Source # to :: Rep (HalfLineLineSegmentIntersection point segment) x -> HalfLineLineSegmentIntersection point segment Source # | |||||
| (Read point, Read segment) => Read (HalfLineLineSegmentIntersection point segment) Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods readsPrec :: Int -> ReadS (HalfLineLineSegmentIntersection point segment) Source # readList :: ReadS [HalfLineLineSegmentIntersection point segment] Source # readPrec :: ReadPrec (HalfLineLineSegmentIntersection point segment) Source # readListPrec :: ReadPrec [HalfLineLineSegmentIntersection point segment] Source # | |||||
| (Show point, Show segment) => Show (HalfLineLineSegmentIntersection point segment) Source # | |||||
Defined in HGeometry.LineSegment.Intersection | |||||
| (Eq point, Eq segment) => Eq (HalfLineLineSegmentIntersection point segment) Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods (==) :: HalfLineLineSegmentIntersection point segment -> HalfLineLineSegmentIntersection point segment -> Bool Source # (/=) :: HalfLineLineSegmentIntersection point segment -> HalfLineLineSegmentIntersection point segment -> Bool Source # | |||||
| (Ord point, Ord segment) => Ord (HalfLineLineSegmentIntersection point segment) Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods compare :: HalfLineLineSegmentIntersection point segment -> HalfLineLineSegmentIntersection point segment -> Ordering Source # (<) :: HalfLineLineSegmentIntersection point segment -> HalfLineLineSegmentIntersection point segment -> Bool Source # (<=) :: HalfLineLineSegmentIntersection point segment -> HalfLineLineSegmentIntersection point segment -> Bool Source # (>) :: HalfLineLineSegmentIntersection point segment -> HalfLineLineSegmentIntersection point segment -> Bool Source # (>=) :: HalfLineLineSegmentIntersection point segment -> HalfLineLineSegmentIntersection point segment -> Bool Source # max :: HalfLineLineSegmentIntersection point segment -> HalfLineLineSegmentIntersection point segment -> HalfLineLineSegmentIntersection point segment Source # min :: HalfLineLineSegmentIntersection point segment -> HalfLineLineSegmentIntersection point segment -> HalfLineLineSegmentIntersection point segment Source # | |||||
| (HasSquaredEuclideanDistance point, HasSquaredEuclideanDistance segment, NumType point ~ NumType segment, Dimension point ~ Dimension segment) => HasSquaredEuclideanDistance (HalfLineLineSegmentIntersection point segment) Source # | |||||
Defined in HGeometry.LineSegment.Intersection Methods squaredEuclideanDistTo :: forall r (d :: Nat) point0. (r ~ NumType (HalfLineLineSegmentIntersection point segment), d ~ Dimension (HalfLineLineSegmentIntersection point segment), Num r, Point_ point0 d r) => point0 -> HalfLineLineSegmentIntersection point segment -> r Source # pointClosestTo :: forall r (d :: Nat) point0. (r ~ NumType (HalfLineLineSegmentIntersection point segment), d ~ Dimension (HalfLineLineSegmentIntersection point segment), Num r, Point_ point0 d r) => point0 -> HalfLineLineSegmentIntersection point segment -> Point d r Source # pointClosestToWithDistance :: forall r (d :: Nat) point0. (r ~ NumType (HalfLineLineSegmentIntersection point segment), d ~ Dimension (HalfLineLineSegmentIntersection point segment), Num r, Point_ point0 d r) => point0 -> HalfLineLineSegmentIntersection point segment -> (Point d r, r) Source # | |||||
| type Rep (HalfLineLineSegmentIntersection point segment) Source # | |||||
Defined in HGeometry.LineSegment.Intersection type Rep (HalfLineLineSegmentIntersection point segment) = D1 ('MetaData "HalfLineLineSegmentIntersection" "HGeometry.LineSegment.Intersection" "hgeometry-kernel-1.0.0.0-inplace" 'False) (C1 ('MetaCons "HalfLine_x_LineSegment_Point" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 point)) :+: C1 ('MetaCons "HalfLine_x_LineSegment_LineSegment" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 segment))) | |||||
| type Dimension (HalfLineLineSegmentIntersection point edge) Source # | |||||
Defined in HGeometry.LineSegment.Intersection | |||||
| type NumType (HalfLineLineSegmentIntersection point edge) Source # | |||||
Defined in HGeometry.LineSegment.Intersection | |||||
data ClosedSegmentHalfSpaceIntersection extra point Source #
Models the intersection of a closed linesegment and halfspace if the segment intersects the bounding hyperplane, the intersection point is of type extra.
Constructors
| ClosedLineSegment_x_HalfSpace_Point point | |
| ClosedLineSegment_x_HalfSpace_SubSegment (ClosedLineSegment (OriginalOrExtra point extra)) | the subsegment is always oriented from the intersection point towards the original point note that this may reverse the original input segment. |
| ClosedLineSegment_x_HalfSpace_CompleteSegment (ClosedLineSegment point) |
Instances
| (Show point, Show extra) => Show (ClosedSegmentHalfSpaceIntersection extra point) Source # | |
Defined in HGeometry.LineSegment.Intersection | |
| (Eq point, Eq extra) => Eq (ClosedSegmentHalfSpaceIntersection extra point) Source # | |
Defined in HGeometry.LineSegment.Intersection Methods (==) :: ClosedSegmentHalfSpaceIntersection extra point -> ClosedSegmentHalfSpaceIntersection extra point -> Bool Source # (/=) :: ClosedSegmentHalfSpaceIntersection extra point -> ClosedSegmentHalfSpaceIntersection extra point -> Bool Source # | |
compareColinearInterval :: forall r point (endPoint :: Type -> Type). (Ord r, Num r, Point_ point 2 r, IxValue (endPoint point) ~ point, EndPoint_ (endPoint point)) => LinePV 2 r -> LineSegment endPoint point -> CompareInterval Source #
Given a line l, and a line segment seg that lies on l. Returns where the anchorPoint of the line is with respect to the line segment (which we can interpret as some interval along l).
pre: the start point of the line segment appears before the end point of the line segment in the direction of the line.