Documentation

# Elementary Polygons

Polygon functions

Given a set of points, you can create simple polygons and compute basic geometric quantities such as area. For more complex polygons or access to more geometric information, create a `polyshape` object. Then, use object functions to modify, query, and visualize the polygon or set of polygons.

## Functions

expand all

 `boundaryshape` Create polyshape from 2-D triangulation `inpolygon` Points located inside or on edge of polygonal region `nsidedpoly` Regular polygon `polyarea` Area of polygon `polybuffer` Create buffer around points, lines, or polyshape objects `rectint` Rectangle intersection area

#### Create and Modify Polyshape

 `polyshape` 2-D polygons `addboundary` Add polyshape boundary `polybuffer` Create buffer around points, lines, or polyshape objects `rmboundary` Remove polyshape boundary `rmholes` Remove holes in polyshape `rmslivers` Remove polyshape boundary outliers `rotate` Rotate polyshape `scale` Scale polyshape `simplify` Simplify polyshape boundaries `sortboundaries` Sort polyshape boundaries `sortregions` Sort polyshape regions `translate` Translate polyshape

#### Query and Visualize

 `boundary` Vertex coordinates of polyshape boundary `holes` Convert polyshape hole boundaries to array of polyshape objects `ishole` Determine if polyshape boundary is a hole `isinterior` Query points inside polyshape `issimplified` Determine if polyshape is well-defined `nearestvertex` Query nearest polyshape vertex `numboundaries` Number of polyshape boundaries `numsides` Number of polyshape sides `overlaps` Determine whether polyshape objects overlap `plot` Plot polyshape `regions` Access polyshape regions

#### Geometric Quantities

 `area` Area of polyshape `boundingbox` Bounding box of polyshape `centroid` Centroid of polyshape `convhull` Convex hull of polyshape `turningdist` Compute turning distance between polyshape objects `triangulation` Triangulate polyshape `perimeter` Perimeter of polyshape

#### Boolean Operations

 `intersect` Intersection of polyshape objects `subtract` Difference of two polyshape objects `union` Union of polyshape objects `xor` Exclusive OR of two polyshape objects