GEOMETRYC - Geometric Calculations
GEOMETRYC is a collection of routines for geometric calculations
in 2, 3 and N space. These calculations include angles, areas,
containment, distances, intersection, nearest point, and volumes.
The objects considered include points, lines, line segments, polygons,
planes, polyhedra and vectors.
GEOMETRYC is a C version of a subset of the
FORTRAN GEOMETRY collection.
-
Reference 1:
-
Adrian Bowyer and John Woodwark,
A Programmer's Geometry,
Butterworths, 1983.
-
Reference 2:
-
Joseph O'Rourke,
Computational Geometry,
Cambridge University Press,
Second Edition, 1998.
Files you may copy include:
The list of routines includes:
-
ANGLE_CONTAINS_RAY_2D determines if an angle contains a ray, in 2D.
-
ANGLE_DEG_2D returns the angle in degrees between two rays in 2D.
-
ANGLE_RAD_2D returns the angle in radians between two rays in 2D.
-
ANGLE_RAD_3D returns the angle in radians between two vectors in 3D.
-
ANGLE_RAD_ND returns the angle in radians between two vectors in ND.
-
ANGLEI_DEG_2D returns the interior angle in degrees between two rays in 2D.
-
ANGLEI_RAD_2D returns the interior angle in radians between two rays in 2D.
-
ARC_COSINE computes the arc cosine function, with argument truncation.
-
ATAN4 computes the inverse tangent of the ratio Y / X.
-
BOX_CONTAINS_POINT_3D determines if a point is inside a parallelepiped in 3D.
-
BOX_POINT_DIST_3D distance ( parallelepiped, point ) in 3D.
-
CIRCLE_DIA2IMP_2D converts a diameter to an implicit circle in 2D.
-
CIRCLE_EXP_CONTAINS_POINT_2D determines if an explicit circle contains a point in 2D.
-
CIRCLE_IMP_CONTAINS_POINT_2D determines if an implicit circle contains a poin
-
CIRCLE_IMP_LINE_PAR_INT_2D: ( implicit circle, parametric line ) intersection
-
CIRCLE_POINTS_2D returns N equally spaced points on the circle in 2D.
-
CONE_AREA_3D computes the surface area of a right circular cone in 3D.
-
CONE_VOLUME_3D computes the volume of a right circular cone in 3D.
-
COT returns the cotangent of an angle.
-
COTD returns the cotangent of an angle given in degrees.
-
CROSS_2D computes the cross product of two vectors in 2D.
-
CROSS_3D computes the cross product of two vectors in 3D.
-
CROSS0_2D computes the cross product of (P1-P0) and (P2-P0) in 2D.
-
CROSS0_3D computes the cross product of (P1-P0) and (P2-P0) in 3D.
-
DIRECTION_PERT_3D randomly perturbs a direction vector in 3D.
-
DIRECTION_RANDOM_3D computes a random direction vector in 3D.
-
DIRECTION_RANDOM_ND computes a random direction vector in ND.
-
DOT_2D computes the dot product of a pair of vectors in 2D.
-
DOT_3D computes the dot product of a pair of vectors in 3D.
-
DOT_ND computes the dot product of a pair of vectors in ND.
-
DOT0_2D computes the dot product of (P1-P0) and (P2-P0) in 2D.
-
DOT0_3D computes the dot product of (P1-P0) and (P2-P0) in 3D.
-
ENORM_2D computes the Euclidean norm of a vector in 2D.
-
ENORM_3D computes the Euclidean norm of a vector in 3D.
-
ENORM_ND computes the Euclidean norm of a vector in ND.
-
ENORM0_2D computes the Euclidean norm of (P1-P0) in 2D.
-
ENORM0_3D computes the Euclidean norm of (P1-P0) in 3D.
-
ENORM0_ND computes the Euclidean norm of (P1-P0) in ND.
-
ENORMSQ0_2D computes the squared Euclidean norm of (P1-P0) in 2D.
-
ENORMSQ0_3D computes the squared Euclidean norm of (P1-P0) in 3D.
-
ENORMSQ0_ND computes the squared Euclidean norm of (P1-P0) in ND.
-
GET_SEED returns a random seed for the random number generator.
-
HALFSPACE_IMP_TRIANGLE_INT_3D: intersection ( implicit halfspace, triangle ) in 3D.
-
HALFSPACE_NORM_TRIANGLE_INT_3D: intersection ( normal halfspace, triangle ) in 3D.
-
HALFSPACE_TRIANGLE_INT_3D: intersection ( halfspace, triangle ) in 3D.
-
I_RANDOM returns a random integer in a given range.
-
LINE_EXP_POINT_DIST_2D: distance ( explicit line, point ) in 2D.
-
LINE_EXP_POINT_DIST_3D: distance ( explicit line, point ) in 3D.
-
LINE_EXP_POINT_DIST_SIGNED_2D: signed distance ( explicit line, point ) in 2D.
-
LINE_EXP2IMP_2D converts an explicit line to implicit form in 2D.
-
LINE_EXP2PAR_3D converts a line from explicit to parametric form in 3D.
-
LINE_SEG_POINT_DIST_3D computes the distance from a point to a line segment in 3D.
-
LINE_SEG_POINT_NEAR_3D finds the point on a line segment nearest a point in 3D.
-
LINES_IMP_ANGLE_2D finds the angle between two implicit lines in 2D.
-
LINES_IMP_INT_2D finds where two implicit lines intersect in 2D.
-
LINES_SEG_DIST_3D computes the distance between two line segments in 3D.
-
MINQUAD finds a local minimum of F(X) = A * X**2 + B * X + C.
-
NORMAL_01_SAMPLE returns random values from the standard 0,1 normal distribution.
-
PARA_CONTAINS_POINT_3D determines if a point is inside a parallelogram in 3D.
-
PARA_POINT_DIST_3D: distance ( parallelogram, point ) in 3D.
-
PARABOLA_EX finds the extremal point of a parabola from 3 data points.
-
PARABOLA_EX2 finds the extremal point of a parabola from 3 data points.
-
PLANE_EXP_NORMAL_3D finds the normal to an explicit plane in 3D.
-
PLANE_EXP2IMP_3D converts an explicit plane to implicit form in 3D.
-
PLANE_EXP2NORM_3D converts an explicit plane to normal form in 3D.
-
PLANE_IMP_LINE_SEG_NEAR_3D: distance ( implicit plane, line segment );
-
PLANE_IMP_POINT_DIST_3D: distance ( point, implicit plane ) in 3D.
-
PLANE_IMP_POINT_DIST_SIGNED_3D: signed distance ( implicit plane, point) in 3D.
-
PLANE_IMP_TRIANGLE_INT_3D intersection ( implicit plane, triangle ) in 3D.
-
PLANE_IMP_TRIANGLE_INT_ADD_3D is a utility for PLANE_IMP_TRIANGLE_INT_3D.
-
PLANE_IMP2NORM_3D converts an implicit plane to normal form in 3D.
-
PLANE_NORM_BASIS_3D finds two perpendicular vectors in a plane in 3D.
-
PLANE_NORM2IMP_3D converts a normal form plane to implicit form in 3D.
-
POINTS_COLIN_2D estimates the colinearity of 3 points in 2D.
-
POINTS_COLIN_3D estimates the colinearity of 3 points in 3D.
-
POLYGON_1_2D integrates the function 1 over a polygon in 2D.
-
POLYGON_AREA_2D computes the area of a polygon in 2D.
-
POLYGON_AREA_2_2D computes the area of a polygon in 2D.
-
POLYGON_AREA_2_3D computes the area of a polygon in 3D.
-
POLYGON_AREA_3D computes the area of a polygon in 3D.
-
POLYGON_CENTROID_2D computes the centroid of a polygon in 2D.
-
POLYGON_CENTROID_2_2D computes the centroid of a polygon in 2D.
-
POLYGON_CENTROID_3D computes the centroid of a polygon in 3D.
-
POLYGON_X_2D integrates the function X over a polygon in 2D.
-
POLYGON_Y_2D integrates the function Y over a polygon in 2D.
-
POLYGON_XX_2D integrates the function X*X over a polygon in 2D.
-
POLYGON_XY_2D integrates the function X*Y over a polygon in 2D.
-
POLYGON_YY_2D integrates the function Y*Y over a polygon in 2D.
-
RMAT2_DET computes the determinant of a 2 by 2 matrix.
-
RMAT2_INVERSE computes the inverse of a 2 by 2 matrix.
-
RMAT3_DET computes the determinant of a 3 by 3 matrix.
-
RMAT3_INVERSE computes the inverse of a 3 by 3 matrix.
-
RMAT4_DET computes the determinant of a 4 by 4 matrix.
-
RMAT5_DET computes the determinant of a 5 by 5 matrix.
-
SPHERE_IMP_VOLUME_3D computes the volume of an implicit sphere in 3D.
-
TAND returns the tangent of an angle given in degrees.
-
TETRA_CENTROID_3D computes the centroid of a tetrahedron in 3D.
-
TMAT_INIT initializes the geometric transformation matrix.
-
TMAT_MXM multiplies two geometric transformation matrices.
-
TMAT_MXP multiplies a geometric transformation matrix times a point.
-
TMAT_MXP2 multiplies a geometric transformation matrix times N points.
-
TMAT_MXV multiplies a geometric transformation matrix times a vector.
-
TMAT_ROT_AXIS applies an axis rotation to the geometric transformation matrix.
-
TMAT_ROT_VECTOR applies a rotation about a vector to the geometric transformation matrix.
-
TMAT_SCALE applies a scaling to the geometric transformation matrix.
-
TMAT_SHEAR applies a shear to the geometric transformation matrix.
-
TMAT_TRANS applies a translation to the geometric transformation matrix.
-
TORUS_VOLUME_3D computes the volume of a torus in 3D.
-
TRIANGLE_AREA_2D computes the area of a triangle in 2D.
-
TRIANGLE_AREA_SIGNED_2D computes the signed area of a triangle in 2D.
-
TRIANGLE_AREA_3D computes the area of a triangle in 3D.
-
TRIANGLE_CENTROID_2D computes the centroid of a triangle in 2D.
-
TRIANGLE_CENTROID_3D computes the centroid of a triangle in 3D.
-
TRIANGLE_INCIRCLE_2D computes the inscribed circle of a triangle in 2D.
-
UNIFORM_01_SAMPLE computes a random value between 0 and 1.
-
VECTOR_ROTATE_2D rotates a vector around the origin in 2D.
-
VECTOR_ROTATE_3D rotates a vector around an axis vector in 3D.
-
VECTOR_UNIT_2D normalizes a vector in 3D.
-
VECTOR_UNIT_3D normalizes a vector in 3D.
-
VECTOR_UNIT_ND normalizes a vector in 3D.
Back to the C software page.
Last revised on 13 June 2002.