TRIANGLE_PROPERTIES Compute Properties of a Triangle

TRIANGLE_PROPERTIES is a FORTRAN77 program which computes properties, including angles, area, centroid, circumcircle, edge lengths, incircle, orientation, orthocenter, and quality, of a triangle in 2D.

These properties include:

• Angles;
• Area;
• Centroid;
• Edge lengths;
• Orientation;
• Orthocenter;

Usage:

triangle_properties filename
where filename contains the vertex coordinates.

Languages:

TRIANGLE_PROPERTIES is available in a C version and a C++ version and a FORTRAN77 version and a FORTRAN90 version and a MATLAB version and a Python version.

Related Data and Programs:

GEOMETRY, a FORTRAN77 library which performs geometric calculations in 2, 3 and N dimensional space.

HYPERSPHERE_PROPERTIES, a FORTRAN77 library which carries out various operations for an M-dimensional 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 FORTRAN77 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 FORTRAN77 program which computes properties of a given tetrahedron.

TRIANGLES, a dataset directory which contains examples of triangles;

List of Routines:

• MAIN is the main program for TRIANGLE_PROPERTIES.
• ARC_COSINE computes the arc cosine function, with argument truncation.
• CH_CAP capitalizes a single character.
• CH_EQI is a case insensitive comparison of two characters for equality.
• CH_TO_DIGIT returns the integer value of a base 10 digit.
• FILE_COLUMN_COUNT counts the number of columns in the first line of a file.
• FILE_ROW_COUNT counts the number of row records in a file.
• GET_UNIT returns a free FORTRAN unit number.
• 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_2D computes a line perpendicular to a line and through a point.
• LINE_EXP2IMP_2D converts an explicit line to implicit form in 2D.
• LINE_IMP_IS_DEGENERATE_2D finds if an implicit point is degenerate in 2D.
• LINES_EXP_INT_2D determines where two explicit lines intersect in 2D.
• LINES_IMP_INT_2D determines where two implicit lines intersect in 2D.
• R8_SWAP swaps two R8's.
• R8MAT_SOLVE uses Gauss-Jordan 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.
• S_TO_R8 reads an R8 from a string.
• S_TO_R8VEC reads an R8VEC from a string.
• S_WORD_COUNT counts the number of "words" in a string.
• TRIANGLE_ANGLES_2D computes the angles of a triangle in 2D.
• TRIANGLE_AREA_2D computes the area of a triangle in 2D.
• TRIANGLE_CENTROID_2D computes the centroid of a triangle in 2D.
• TRIANGLE_CIRCUMCIRCLE_2D computes the circumcircle of a triangle in 2D.
• TRIANGLE_EDGE_LENGTH_2D returns edge lengths of a triangle in 2D.
• TRIANGLE_INCIRCLE_2D computes the inscribed circle of a triangle in 2D.
• TRIANGLE_ORIENTATION_2D determines the orientation of a triangle in 2D.
• TRIANGLE_ORTHOCENTER_2D computes the orthocenter of a triangle in 2D.
• TRIANGLE_QUALITY_2D: "quality" of a triangle in 2D.
• TIMESTAMP prints the current YMDHMS date as a time stamp.

You can go up one level to the FORTRAN77 source codes.

Last revised on 06 May 2014.