polygon


polygon, an Octave code which computes properties of an arbitrary polygon in the plane, defined by a sequence of vertices, including interior angles, area, centroid, containment of a point, convexity, counter clockwise ordering, diameter, distance to a point, inradius, lattice area, nearest point in set, outradius, uniform sampling, and triangulation.

Licensing:

The computer code and data files described and made available on this web page are distributed under the MIT license

Languages:

polygon is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version and a Python version.

Related Programs:

polygon_test

ellipse, an Octave code which carries out geometric calculations for ellipses and ellipsoids, including area, distance to a point, eccentricity, perimeter, points along the perimeter, random sampling, conversion between standard and quadratic forms.

polygon_average, an Octave code which demonstrates a process of repeatedly averaging and normalizing the vertices of a polygon, illustrating a property of the power method.

polygon_distance, an Octave code which computes the expected value of the distance between a pair of points randomly selected from a polygon in 2D.

polygon_grid, an Octave code which generates a grid of points over the interior of a polygon in 2D.

polygon_integrals, an Octave code which returns the exact value of the integral of any monomial over the interior of a polygon in 2D.

polygon_monte_carlo, an Octave code which applies a monte carlo method to estimate the integral of a function over the interior of a polygon in 2d.

polygon_triangulate, an Octave code which triangulates a (possibly nonconvex) polygon, based on a C function by Joseph Orourke.

quadrilateral, an Octave code which carries out geometric calculations on quadrilaterals, including angles, area, distances, nearest point, point containment, perimeter, and random generation.

tetrahedron, an Octave code which carries out geometric calculations involving a general tetrahedron, including solid and facial angles, face areas, point containment, distances to a point, circumsphere and insphere, measures of shape quality, centroid, barycentric coordinates, edges and edge lengths, random sampling, and volumes.

Source code:


Last revised on 17 December 2022.