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

Safe HaskellNone
LanguageHaskell2010

Data.Geometry.PolyLine

Contents

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

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.