Copyright | (C) Frank Staals |
---|---|
License | see the LICENSE file |
Maintainer | Frank Staals |
Safe Haskell | None |
Language | Haskell2010 |
SubLine; a part of a line
Synopsis
- data SubLine d p s r = SubLine {}
- line :: Lens (SubLine d1 p s r1) (SubLine d2 p s r2) (Line d1 r1) (Line d2 r2)
- subRange :: Lens (SubLine d p1 s1 r) (SubLine d p2 s2 r) (Interval p1 s1) (Interval p2 s2)
- fixEndPoints :: (Num r, Arity d) => SubLine d p r r -> SubLine d (Point d r :+ p) r r
- dropExtra :: SubLine d p s r -> SubLine d () s r
- _unBounded :: Prism' (SubLine d p (UnBounded r) r) (SubLine d p r r)
- toUnbounded :: SubLine d p r r -> SubLine d p (UnBounded r) r
- fromUnbounded :: SubLine d p (UnBounded r) r -> Maybe (SubLine d p r r)
- onSubLine :: (Ord r, Fractional r, Arity d) => Point d r -> SubLine d p r r -> Bool
- onSubLineUB :: (Ord r, Fractional r) => Point 2 r -> SubLine 2 p (UnBounded r) r -> Bool
- onSubLine2 :: (Ord r, Num r) => Point 2 r -> SubLine 2 p r r -> Bool
- onSubLine2UB :: (Ord r, Fractional r) => Point 2 r -> SubLine 2 p (UnBounded r) r -> Bool
- getEndPointsUnBounded :: (Num r, Arity d) => SubLine d p (UnBounded r) r -> Interval p (UnBounded (Point d r))
- fromLine :: Arity d => Line d r -> SubLine d () (UnBounded r) r
Documentation
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.
Instances
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