You are here: Start » AVL.NET » Function Reference » Path » Polygon Features » AVL.PolygonConvexity
Computes the area of a polygon divided by the area of its convex hull.
Namespace: | AvlNet |
---|---|
Assembly: | AVL.NET.dll |
Syntax
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
inPolygon | AvlNet.Path | ||||
outConvexity | float |
Description
Convexity is a measure of how close a polygon is to being convex. Convex polygons have convexity equal to 1.0, while the more concave the polygon is, the closer to 0.0 is its convexity.
Mathematically, the convexity is calculated as follows:
Note that if the input path is not a valid polygon (i.e. it has at least one self-intersection), the computation may lead to results that are not intuitive.
Examples
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Degenerate polygon on input in PolygonConvexity. |
DomainError | Open path on input in PolygonConvexity. |