hgeometry-polygon
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageGHC2024

HGeometry.Polygon

Description

A polygon and some basic functions to interact with them.

Synopsis

Documentation

asTriangle :: Polygon_ polygon point r => polygon -> Maybe (Triangle point) Source #

Try to convert the polygon into a triangle (whose vertices are given in CCW order).

area2X :: (Polygon_ polygon point r, Num r, Point_ point 2 r, SimplePolygon_ (Hole polygon) point r) => polygon -> r Source #

Computes the double area of a polygon

area :: (Polygon_ polygon point r, SimplePolygon_ (Hole polygon) point r, Fractional r) => polygon -> r Source #

The area of a polygon

running time: \(O(n)\)