hgeometry-0.6.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

Instances

Arity d => Bifunctor (PolyLine d) Source # 

Methods

bimap :: (a -> b) -> (c -> d) -> PolyLine d a c -> PolyLine d b d #

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 # 

Methods

fmap :: (a -> b) -> PolyLine d p a -> PolyLine d p b #

(<$) :: a -> PolyLine d p b -> PolyLine d p a #

PointFunctor (PolyLine d p) Source # 

Methods

pmap :: (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 # 

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 # 

Methods

compare :: 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 # 

Methods

showsPrec :: Int -> PolyLine d p r -> ShowS #

show :: PolyLine d p r -> String #

showList :: [PolyLine d p r] -> ShowS #

Semigroup (PolyLine d p r) Source # 

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 #

(Num r, AlwaysTruePFT d) => IsTransformable (PolyLine d p r) Source # 

Methods

transformBy :: 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 # 

Methods

boundingBox :: PolyLine d p r -> Box (Dimension (PolyLine d p r)) () (NumType (PolyLine d p r)) Source #

Coordinate r => IpeRead (PolyLine 2 () r) Source # 
Coordinate r => IpeReadText (PolyLine 2 () r) Source # 
(IpeWriteText r, IpeWrite p) => IpeWrite (PolyLine 2 p r) Source # 

Methods

ipeWrite :: PolyLine 2 p r -> Maybe (Node Text Text) Source #

IpeWriteText r => IpeWriteText (PolyLine 2 () r) Source # 

Methods

ipeWriteText :: PolyLine 2 () r -> Maybe Text Source #

HasDefaultIpeOut (PolyLine 2 p r) Source # 

Associated Types

type DefaultIpeOut (PolyLine 2 p r) :: * -> * Source #

type NumType (PolyLine d p r) Source # 
type NumType (PolyLine d p r) = r
type Dimension (PolyLine d p r) Source # 
type Dimension (PolyLine d p r) = d
type DefaultIpeOut (PolyLine 2 p r) Source # 
type DefaultIpeOut (PolyLine 2 p r) = Path

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.