hgeometry-0.1.1.1: Geometry types in Haskell

Safe HaskellNone

Data.Geometry.Polygon

Synopsis

Documentation

class (HasPoints p, IsTransformable p) => IsPolygon p whereSource

Polygons

Class that defines what a polygon is. Note that it is assumed that the first and the last point are *NOT* the same point.

Methods

vertices :: p a -> [Point2' a]Source

edges :: p a -> [(Point2' a, Point2' a)]Source

default implementation assumes points are in order

isSimple :: p a -> BoolSource

containsHoles :: p a -> BoolSource

Instances

IsPolygon BoundingBox2'

Bounding boxes can be used as polygons

IsPolygon MultiPolygon' 
IsPolygon SimplePolygon' 

data SimplePolygon' a Source

Simple polygons, i.e. polygons consisting of a sequence of points (vertices) | such that the edges do not intersect. Simple polygons do not contain holes

Constructors

SimplePolygon [Point2' a] 

data MultiPolygon' a Source

A multipolygon consists of several simple polygons

Constructors

MultiPolygon [SimplePolygon' a]