Properties of a Triangle
is a Python program which
can compute properties, including angles, area, centroid, circumcircle,
edge lengths, incircle, orientation, orthocenter, and quality,
of a triangle in 2D.
These properties include:
Circumcircle (center and radius);
Incircle (center and radius);
Quality: ratio of incircle radius / circumcircle radius;
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
TRIANGLE_PROPERTIES is available in
a C version and
a C++ version and
a FORTRAN90 version and
a MATLAB version and
a Python version.
Related Data and Programs:
a Python library 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, diameter, distance to a point,
inradius, lattice area, nearest point in set, outradius, uniform sampling.
a Python library which
shows how vertex data can be interpolated at any point
in the interior of a triangle.
a dataset directory which
contains examples of triangles;
returns the nonnegative remainder of integer division;
forces an integer to lie in a given range;
returns a line perpendicular to an explicit line in 2D;
converts an explicit line to an implicit line in 2D;
finds the intersection of two explicit lines in 2D;
finds the intersection of two implicit lines in 2D;
computes the inverse cosine of C;
prints an R8MAT;
prints some of an R8MAT;
solves an N by N linear system with multiple right hand sides.
prints the transpose of an R8MAT;
prints some of the transpose of an R8MAT;
prints an R8VEC;
returns a unit pseudorandom R8VEC.
computes the distance between a point and a line segment in 2D;
returns the nearest line segment point to a point in 2D;
prints the current YMDHMS date as a timestamp;
returns the angles of a triangle in 2D;
returns the area of a triangle in 2D;
returns the centroid of a triangle in 2D;
returns the circumcenter of a triangle in 2D;
determines if a point is in a triangle in 2D;
returns the edge lengths of a triangle in 2D;
returns the incircle of a triangle in 2D;
returns the orientation of a triangle in 2D;
returns the orthocenter of a triangle in 2D;
returns the distance of point to a triangle in 2D;
returns the nearest point on a triangle in 2D;
returns the shape quality of a triangle in 2D;
randomly samples a point from the reference triangle in 2D;
randomly samples a point from a triangle in 2D;
converts barycentric to cartesian coordinates in a triangle in 2D;
converts cartesian to barycentric coordinates in a triangle in 2D;
Examples and Tests:
You can go up one level to
the Python source codes.
Last revised on 09 November 2015.