Polygons Milestone
http://people.sc.fsu.edu/~jburkardt/classes/urop_2016/polygons_milestone.html
In the triangles milestone, we learned how to make some useful
calculations for triangles. We could now proceed to study
one by one the other polygons, such as quadrilaterals,
five-sided figures and so on. Instead, we would like to
consider what measurements we can make on any polygon, by
using what we know about triangles. The key to this approach
begins by regarding any polygon as simply a collection of
triangles.
Topics:
-
representing a polygon as a Nx2 array of coordinates; as
a list of the coordinates of N points; as a list of the
indexes of N points whose coordinates are listed elsewhere;
-
the counter-clockwise convention for describing polygons;
-
the perimeter and angles of a polygon;
-
how a polygon can easily be triangulated into triangles,
although some area might be negative;
-
the centroid and area of a polygon
(OK even if some triangles have negative area);
-
how a to use a function such as "polygon_triangulate(),
that triangulates a polygon into triangles whose area
is guaranteed to be nonnegative.
-
is a point inside a polygon (triangles must have nonnegative area)?
-
generating uniform random sample points in a polygon
(triangles must have nonnegative area);
-
estimating an integral over a polygon using sampling
(triangles must have nonnegative area);
Last revised on 27 October 2016.