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

Data.Geometry.PolyLine

Synopsis

# d-dimensional Polygonal Lines (PolyLines)

newtype PolyLine d p r Source

A Poly line in R^d

Constructors

 PolyLine Fields_points :: Seq2 (Point d r :+ p)

Instances

 Arity d => Bifunctor (PolyLine d) Source Arity d => Functor (PolyLine d p) Source PointFunctor (PolyLine d p) Source (Eq r, Eq p, Arity d) => Eq (PolyLine d p r) Source (Ord r, Ord p, Arity d) => Ord (PolyLine d p r) Source (Show r, Show p, Arity d) => Show (PolyLine d p r) Source Semigroup (PolyLine d p r) Source (Num r, AlwaysTruePFT d) => IsTransformable (PolyLine d p r) Source Arity d => IsBoxable (PolyLine d p r) Source (IpeWriteText r, IpeWrite p) => IpeWrite (PolyLine 2 p r) Source IpeWriteText r => IpeWriteText (PolyLine 2 () r) Source Coordinate r => IpeRead (PolyLine 2 () r) Source Coordinate r => IpeReadText (PolyLine 2 () r) Source HasDefaultIpeOut (PolyLine 2 p r) Source type NumType (PolyLine d p r) = r Source type Dimension (PolyLine d p r) = d Source type DefaultIpeOut (PolyLine 2 p r) = Path Source

points :: forall d p r d p r. Iso (PolyLine d p r) (PolyLine d p r) (Seq2 ((:+) (Point d r) p)) (Seq2 ((:+) (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.