| Safe Haskell | None |
|---|
Data.Geometry.Polygon
- class (HasPoints p, IsTransformable p) => IsPolygon p where
- data SimplePolygon' a = SimplePolygon [Point2' a]
- data MultiPolygon' a = MultiPolygon [SimplePolygon' a]
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
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] |
Instances
| HasPoints SimplePolygon' | |
| IsPoint2Functor SimplePolygon' | |
| IsPolygon SimplePolygon' | |
| Eq a => Eq (SimplePolygon' a) | |
| Show a => Show (SimplePolygon' a) |
data MultiPolygon' a Source
A multipolygon consists of several simple polygons
Constructors
| MultiPolygon [SimplePolygon' a] |
Instances
| HasPoints MultiPolygon' | |
| IsPoint2Functor MultiPolygon' | |
| IsPolygon MultiPolygon' | |
| Eq a => Eq (MultiPolygon' a) | |
| Show a => Show (MultiPolygon' a) |