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

Safe Haskell None Haskell2010

Data.Geometry.PolyLine

Synopsis

d-dimensional Polygonal Lines (PolyLines)

newtype PolyLine d p r Source #

A Poly line in R^d has at least 2 vertices

Constructors

 PolyLine Fields_points :: LSeq 2 (Point d r :+ p)
Instances
 Arity d => Bifunctor (PolyLine d) Source # Instance detailsDefined in Data.Geometry.PolyLine Methodsbimap :: (a -> b) -> (c -> d0) -> PolyLine d a c -> PolyLine d b d0 #first :: (a -> b) -> PolyLine d a c -> PolyLine d b c #second :: (b -> c) -> PolyLine d a b -> PolyLine d a c # Arity d => Functor (PolyLine d p) Source # Instance detailsDefined in Data.Geometry.PolyLine Methodsfmap :: (a -> b) -> PolyLine d p a -> PolyLine d p b #(<\$) :: a -> PolyLine d p b -> PolyLine d p a # PointFunctor (PolyLine d p) Source # Instance detailsDefined in Data.Geometry.PolyLine Methodspmap :: (Point (Dimension (PolyLine d p r)) r -> Point (Dimension (PolyLine d p s)) s) -> PolyLine d p r -> PolyLine d p s Source # (Eq r, Eq p, Arity d) => Eq (PolyLine d p r) Source # Instance detailsDefined in Data.Geometry.PolyLine Methods(==) :: PolyLine d p r -> PolyLine d p r -> Bool #(/=) :: PolyLine d p r -> PolyLine d p r -> Bool # (Ord r, Ord p, Arity d) => Ord (PolyLine d p r) Source # Instance detailsDefined in Data.Geometry.PolyLine Methodscompare :: PolyLine d p r -> PolyLine d p r -> Ordering #(<) :: PolyLine d p r -> PolyLine d p r -> Bool #(<=) :: PolyLine d p r -> PolyLine d p r -> Bool #(>) :: PolyLine d p r -> PolyLine d p r -> Bool #(>=) :: PolyLine d p r -> PolyLine d p r -> Bool #max :: PolyLine d p r -> PolyLine d p r -> PolyLine d p r #min :: PolyLine d p r -> PolyLine d p r -> PolyLine d p r # (Show r, Show p, Arity d) => Show (PolyLine d p r) Source # Instance detailsDefined in Data.Geometry.PolyLine MethodsshowsPrec :: Int -> PolyLine d p r -> ShowS #show :: PolyLine d p r -> String #showList :: [PolyLine d p r] -> ShowS # Semigroup (PolyLine d p r) Source # Instance detailsDefined in Data.Geometry.PolyLine Methods(<>) :: PolyLine d p r -> PolyLine d p r -> PolyLine d p r #sconcat :: NonEmpty (PolyLine d p r) -> PolyLine d p r #stimes :: Integral b => b -> PolyLine d p r -> PolyLine d p r # (Fractional r, Arity d, Arity (d + 1)) => IsTransformable (PolyLine d p r) Source # Instance detailsDefined in Data.Geometry.PolyLine MethodstransformBy :: Transformation (Dimension (PolyLine d p r)) (NumType (PolyLine d p r)) -> PolyLine d p r -> PolyLine d p r Source # Arity d => IsBoxable (PolyLine d p r) Source # Instance detailsDefined in Data.Geometry.PolyLine MethodsboundingBox :: PolyLine d p r -> Box (Dimension (PolyLine d p r)) () (NumType (PolyLine d p r)) Source # type NumType (PolyLine d p r) Source # Instance detailsDefined in Data.Geometry.PolyLine type NumType (PolyLine d p r) = r type Dimension (PolyLine d p r) Source # Instance detailsDefined in Data.Geometry.PolyLine type Dimension (PolyLine d p r) = d

points :: forall d p r d p r. Iso (PolyLine d p r) (PolyLine d p r) (LSeq 2 ((:+) (Point d r) p)) (LSeq 2 ((:+) (Point d r) p)) Source #

fromPoints :: [Point d r :+ p] -> PolyLine d p r Source #

pre: The input list contains at least two points

fromPoints' :: Monoid p => [Point d r] -> PolyLine d p r Source #

pre: The input list contains at least two points. All extra vields are initialized with mempty.

fromLineSegment :: LineSegment d p r -> PolyLine d p r Source #

We consider the line-segment as closed.

asLineSegment :: PolyLine d p r -> LineSegment d p r Source #

Convert to a closed line segment by taking the first two points.

asLineSegment' :: PolyLine d p r -> Maybe (LineSegment d p r) Source #

Stricter version of asLineSegment that fails if the Polyline contains more than two points.