TRIANGLE_PROPERTIES
Properties of a Triangle
TRIANGLE_PROPERTIES
is a FORTRAN90 library which
can compute properties of a triangle, including angles, area, centroid, circumcircle,
edge lengths, incircle, orientation, orthocenter, and quality.
These properties include:

Angles;

Area;

Centroid;

Circumcircle (center and radius);

Edge lengths;

Incircle (center and radius);

Orientation;

Orthocenter;

Quality: ratio of incircle radius / circumcircle radius;
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
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:
GEOMETRY,
a FORTRAN90 library which
performs geometric calculations in 2, 3 and N dimensional space.
HYPERSPHERE_PROPERTIES,
a FORTRAN90 library which
carries out various operations for an Mdimensional hypersphere, including
converting between Cartesian and spherical coordinates,
stereographic projection, sampling the surface of the sphere, and
computing the surface area and volume.
POLYGON_PROPERTIES,
a FORTRAN90 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.
TETRAHEDRON_PROPERTIES,
a FORTRAN90 program which
computes properties of a given tetrahedron.
TRIANGLE_ANALYZE,
a FORTRAN90 program which
reads a triangle from a file, and then reports various properties.
TRIANGLE_INTERPOLATE,
a FORTRAN90 library which
shows how vertex data can be interpolated at any point
in the interior of a triangle.
TRIANGLES,
a dataset directory which
contains examples of triangles;
Source Code:
Examples and Tests:
List of Routines:

I4_MODP returns the nonnegative remainder of integer division.

I4_WRAP forces an I4 to lie between given limits by wrapping.

LINE_EXP_IS_DEGENERATE_ND finds if an explicit line is degenerate in ND.

LINE_EXP_PERP computes a line perpendicular to a line and through a point.

LINE_EXP2IMP converts an explicit line to implicit form in 2D.

LINE_IMP_IS_DEGENERATE finds if an implicit point is degenerate in 2D.

LINES_EXP_INT determines where two explicit lines intersect in 2D.

LINES_IMP_INT determines where two implicit lines intersect in 2D.

R8_ACOS computes the arc cosine function, with argument truncation.

R8_HUGE returns a very large R8.

R8_UNIFORM_01 returns a unit pseudorandom R8.

R8MAT_SOLVE uses GaussJordan elimination to solve an N by N linear system.

R8MAT_TRANSPOSE_PRINT prints an R8MAT, transposed.

R8MAT_TRANSPOSE_PRINT_SOME prints some of an R8MAT, transposed.

R8VEC_LENGTH returns the Euclidean length of a vector.

R8VEC_PRINT prints an R8VEC.

R8VEC_UNIFORM_01 returns a unit pseudorandom R8VEC.

SEGMENT_POINT_DIST: distance ( line segment, point ) in 2D.

SEGMENT_POINT_NEAR: nearest point on line segment to point in 2D.

TIMESTAMP prints the current YMDHMS date as a time stamp.

TRIANGLE_ANGLES computes the angles of a triangle.

TRIANGLE_AREA computes the area of a triangle in 2D.

TRIANGLE_CENTROID computes the centroid of a triangle in 2D.

TRIANGLE_CIRCUMCIRCLE computes the circumcircle of a triangle in 2D.

TRIANGLE_CONTAINS_POINT finds if a point is inside a triangle in 2D.

TRIANGLE_DIAMETER computes the diameter of a triangle in 2D.

TRIANGLE_EDGE_LENGTH returns edge lengths of a triangle in 2D.

TRIANGLE_INCIRCLE computes the inscribed circle of a triangle in 2D.

TRIANGLE_ORIENTATION determines the orientation of a triangle in 2D.

TRIANGLE_ORTHOCENTER computes the orthocenter of a triangle in 2D.

TRIANGLE_POINT_DIST: distance ( triangle, point ) in 2D.

TRIANGLE_POINT_NEAR computes the nearest point on a triangle in 2D.

TRIANGLE_QUALITY: "quality" of a triangle in 2D.

TRIANGLE_REFERENCE_SAMPLE returns random points in the reference triangle.

TRIANGLE_SAMPLE returns random points in a triangle.

TRIANGLE_XSI_TO_XY converts from barycentric to XY coordinates in 2D.

TRIANGLE_XY_TO_XSI converts from XY to barycentric in 2D.
You can go up one level to
the FORTRAN90 source codes.
Last revised on 21 October 2015.