Perform geometric operations on polygons in C#
This program builds a Polygon class that demonstrates several useful geometric algorithms including:
- PolygonIsConvex - Returns True if the polygon is convex
- PointInPolygon - Returns True if a point in inside the polygon
- PolygonArea - Returns the polygon's area
- FindCentroid - Returns the polygon's centroid ("center of mass")
- PolygonIsOrientedClockwise - Returns True if the polygon's points are oriented clockwise
- Reverse - Reverses the order of the polygon's points
- Triangulate - Chops the polygon into triangles
- FindSmallestBoundingRectangle - Returns a smallest rectangle that surrounds the polygon (not necessarily parallel to the X and Y axes)



Comments