TETRAHEDRON_PROPERTIES
Compute Properties of a Tetrahedron
TETRAHEDRON_PROPERTIES
is a C program which
computes properties, including the centroid,
circumsphere, dihedral angles, edge lengths, face angles, face areas,
insphere, quality, solid angles, and volume
of a tetrahedron in 3D.
Usage:
tetrahedron_properties filename
where filename contains the vertex coordinates.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
TETRAHEDRON_PROPERTIES is available in
a C version and
a C++ version and
a FORTRAN90 version and
a MATLAB version.
Related Data and Programs:
GEOMETRY,
a C library which
performs geometric calculations in 2, 3 and N dimensional space.
HYPERSPHERE_PROPERTIES,
a C 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 C 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.
TETRAHEDRONS,
a dataset directory which
contains examples of tetrahedrons;
TRIANGLE_PROPERTIES,
a C program which
computes properties of a triangle
whose vertex coordinates are read from a file.
Source Code:
Examples and Tests:

tet_cap.txt,
a "cap" tetrahedron.

tet_cap_output.txt,
the output file.

tet_equilateral.txt,
an equilateral tetrahedron.

tet_equilateral_output.txt,
the output file.

tet_needle.txt,
a "needle" tetrahedron.

tet_needle_output.txt,
the output file.

tet_right.txt,
a right tetrahedron.

tet_right_output.txt,
the output file.

tet_sliver.txt,
a "sliver" tetrahedron.

tet_sliver_output.txt,
the output file.

tet_spindle.txt,
a "spindle" tetrahedron.

tet_spindle_output.txt,
the output file.

tet_wedge.txt,
a "wedge" tetrahedron.

tet_wedge_output.txt,
the output file.
List of Routines:

MAIN is the main program for TETRAHEDRON_PROPERTIES.

ARC_COSINE computes the arc cosine function, with argument truncation.

CH_CAP capitalizes a single character.

CH_EQI is true if two characters are equal, disregarding case.

CH_TO_DIGIT returns the integer value of a base 10 digit.

FILE_COLUMN_COUNT counts the columns in the first line of a file.

FILE_ROW_COUNT counts the number of row records in a file.

I4_MAX returns the maximum of two I4's.

I4_MIN returns the minimum of two I4's.

R8_ABS returns the absolute value of an R8.

R8_HUGE returns a "huge" R8.

R8_MAX returns the maximum of two R8's.

R8_MIN returns the minimum of two R8's.

R8_SWAP switches two R8's.

R8MAT_DATA_READ reads the data from an R8MAT file.

R8MAT_HEADER_READ reads the header from an R8MAT file.

R8MAT_DET_4D computes the determinant of a 4 by 4 R8MAT.

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_ANGLE_3D computes the angle between two vectors in 3D.

R8VEC_CROSS_3D computes the cross product of two R8VEC's in 3D.

R8VEC_DOT_PRODUCT computes the dot product of a pair of R8VEC's in ND.

R8VEC_NORM returns the Euclidean length of an R8VEC.

R8VEC_MAX returns the value of the maximum element in an R8VEC.

R8VEC_PRINT prints an R8VEC.

R8VEC_ZERO zeroes an R8VEC.

S_LEN_TRIM returns the length of a string to the last nonblank.

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.

TETRAHEDRON_CENTROID computes the centroid of a tetrahedron.

TETRAHEDRON_CIRCUMSPHERE computes the circumsphere of a tetrahedron.

TETRAHEDRON_DIHEDRAL_ANGLES computes dihedral angles of a tetrahedron.

TETRAHEDRON_EDGE_LENGTH returns edge lengths of a tetrahedron.

TETRAHEDRON_FACE_ANGLES returns the 12 face angles of a tetrahedron.

TETRAHEDRON_FACE_AREAS returns the 4 face areas of a tetrahedron.

TETRAHEDRON_INSPHERE finds the insphere of a tetrahedron.

TETRAHEDRON_QUALITY1: "quality" of a tetrahedron.

TETRAHEDRON_QUALITY2: "quality" of a tetrahedron.

TETRAHEDRON_QUALITY3 computes the mean ratio of a tetrahedron.

TETRAHEDRON_QUALITY4 computes the minimum solid angle of a tetrahedron.

TETRAHEDRON_SOLID_ANGLES computes solid angles of a tetrahedron.

TETRAHEDRON_VOLUME computes the volume of a tetrahedron.

TIMESTAMP prints the current YMDHMS date as a time stamp.

TRIANGLE_ANGLES_3D computes the angles of a triangle in 3D.

TRIANGLE_AREA_3D computes the area of a triangle in 3D.
You can go up one level to
the C source codes.
Last revised on 12 May 2014.