GEOMETRY
Geometric Calculations
GEOMETRY
is a Python library which
carries out geometric calculations in 2, 3 and N space.
These calculations include angles, areas, containment, distances,
intersections, lengths, and volumes.
Some geometric objects can be described in a variety of ways.
For instance, a line has implicit, explicit and parametric
representations. The names of routines often will specify
the representation used, and there are routines to convert
from one representation to another.
Another useful task is the delineation of a standard geometric
object. For instance, there is a routine that will return
the location of the vertices of an octahedron, and others to
produce a series of "equally spaced" points on a circle, ellipse,
sphere, or within the interior of a triangle.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
GEOMETRY is available in
a C version and
a C++ version and
a FORTRAN90 version and
a MATLAB version and
a Python version.
Related Programs:
Source code:
-
angle_degree.py,
computes an angle in degrees.
-
angle_half.py
finds half an angle.
-
angle_radian.py
returns the angle in radians swept out between two rays.
-
ball01_volume.py,
returns the volume of the unit ball.
-
circle_sector_area.py,
returns the area of a circle.
-
circle01_length.py,
returns the length of the unit circle.
-
cone_volume.py,
returns the volume of a cone.
-
cube01_volume.py,
returns the volume of the unit cube.
-
degrees_to_radians.py,
converts an angle from degrees_to_radians.
-
disk01_area.py,
returns the area of the unit disk.
-
disk01_quarter_area.py,
returns the area of the unit quarter disk.
-
ellipse_area1.py,
computes the area of the ellipse x'*A*x=r^2;
-
ellipse_area2.py,
computes the area of the ellipse a*x^2+b*xy+c*y^2=d.
-
ellipse_area3.py,
computes the area of the ellipse (x/r1)^2+(y/r2)^2=1.
-
ellipse_point_near.py,
returns the nearest point on an ellipse in 2D;
-
ellipsoid_volume.py,
returns the volume of an ellipsoid.
-
hyperball01_volume.py,
returns the volume of the unit hyperball.
-
hypercube01_volume.py,
returns the volume of the unit hypercube.
-
hypersphere01_area.py,
returns the area of the unit hypersphere.
-
i4_modp.py,
returns the nonnegative remainder of integer division;
-
i4_wrap.py,
forces an integer to lie in a given range;
-
line_exp_perp.py,
returns a line perpendicular to an explicit line in 2D;
-
line_exp2imp.py,
converts an explicit line to an implicit line in 2D;
-
line_imp2exp.py,
converts an implicit line to an explicit line in 2D;
-
lines_exp_int.py,
finds the intersection of two explicit lines in 2D;
-
lines_imp_int.py,
finds the intersection of two implicit lines in 2D;
-
polygon_angles.py
computes the interior angles of a polygon.
-
polygon_area.py
computes the area of a polygon.
-
polygon_area_2.py
computes the area of a polygon.
-
polygon_centroid.py
computes the centroid of a polygon.
-
polygon_centroid_2.py
computes the centroid of a polygon.
-
polygon_contains_point.py
finds if a point is inside a simple polygon.
-
polygon_contains_point_2.py
is a point inside a convex polygon.
-
polygon_diameter.py
computes the diameter of a polygon.
-
polygon_expand.py
expands a polygon.
-
polygon_inrad_data.py
determines polygonal data from its inner radius.
-
polygon_integral_1.py
integrates the function 1 over a polygon.
-
polygon_integral_x.py
integrates the function X over a polygon.
-
polygon_integral_xx.py
integrates the function X*X over a polygon.
-
polygon_integral_xy.py
integrates the function X*Y over a polygon.
-
polygon_integral_y.py
integrates the function Y over a polygon.
-
polygon_integral_yy.py
integrates the function Y*Y over a polygon.
-
polygon_is_convex.py
determines whether a polygon is convex.
-
polygon_lattice_area.py
computes the area of a lattice polygon.
-
polygon_outrad_data.py
determines polygonal data from its outer radius.
-
polygon_perimeter.py
determines the length of the perimeter of a polygon.
-
polygon_perimeter_quad.py
estimates the integral of a scalar function over the perimeter of a polygon.
-
polygon_point_dist.py
distance ( polygon, point ).
-
polygon_point_near.py
computes the nearest point on a polygon.
-
polygon_sample.py
returns sample points from a polygon.
-
polygon_side_data.py
determines polygonal data from its side length.
-
polygon_triangulate.py
triangulates a polygon.
-
pyramid_volume.py
returns the volume of a pyramid.
-
pyramid01_volume.py
returns the volume of the unit pyramid.
-
r8_acos.py,
returns the arc-cosine of an R8.
-
r8_atan.py
computes the arc-tangent of a ratio of R8 values.
-
r8_sign.py,
returns the sign of an R8.
-
r8_uniform_01.py
returns random R8 values in [0,1].
-
r8_uniform_ab.py
returns random R8 values in [A,B].
-
r8mat_det_4d.py,
computes the determinant of a 4x4 R8MAT;
-
r8mat_print.py,
prints an R8MAT;
-
r8mat_print_some.py,
prints some of an R8MAT;
-
r8mat_solve.py,
solves an N by N linear system with multiple right hand sides.
-
r8mat_transpose_print.py,
prints the transpose of an R8MAT;
-
r8mat_transpose_print_some.py,
prints some of the transpose of an R8MAT;
-
r8vec_print.py,
prints an R8VEC;
-
r8vec_uniform_01.py,
returns a unit pseudorandom R8VEC.
-
r8vec_uniform_ab.py,
returns a pseudorandom R8VEC in [A,B].
-
r8vec2_print.py,
prints a pair of R8VEC's;
-
r8vec3_print.py,
prints a triple of R8VEC's;
-
radians_to_degrees.py,
converts an angle from radians to degrees.
-
segment_point_dist_2d.py,
computes the distance between a point and a line segment in 2D;
-
segment_point_near_2d.py,
returns the nearest line segment point to a point in 2D;
-
simplex01_volume.py,
returns the volume of the unit simplex.
-
sphere_triangle_sides_to_angles.py,
computes spherical triangle angles in 3D.
-
sphere01_area.py,
area of unit sphere in ND.
-
sphere01_area_values.py,
tabulated areas of unit sphere in ND.
-
sphere01_volume_values.py,
tabulated volumes of unit sphere in ND.
-
tetrahedron_barycentric.py,
returns the barycentric coordinates of points in a general tetrahedron.
-
tetrahedron_centroid.py,
returns the centroid of a general tetrahedron.
-
tetrahedron_sample.py,
samples points from a general tetrahedron.
-
tetrahedron_volume.py,
returns the volume of a general tetrahedron.
-
tetrahedron01_volume.py,
returns the volume of the unit tetrahedron.
-
timestamp.py,
prints the current YMDHMS date as a timestamp;
-
triangle_angles.py,
returns the angles of a triangle in 2D;
-
triangle_area.py,
returns the area of a triangle in 2D;
-
triangle_barycentric.py,
returns the barycentric coordinates of a point in a triangle.
-
triangle_centroid.py,
returns the centroid of a triangle in 2D;
-
triangle_circumcircle.py,
returns the circumcenter of a triangle in 2D;
-
triangle_contains_point.py,
determines if a point is in a triangle in 2D;
-
triangle_contains_point_1.py,
determines if a point is in a triangle in 2D;
-
triangle_diameter.py,
returns the diameter of a triangle in 2D;
-
triangle_edge_length.py,
returns the edge lengths of a triangle in 2D;
-
triangle_incircle.py,
returns the incircle of a triangle in 2D;
-
triangle_orientation.py,
returns the orientation of a triangle in 2D;
-
triangle_orthocenter.py,
returns the orthocenter of a triangle in 2D;
-
triangle_point_dist.py,
returns the distance of point to a triangle in 2D;
-
triangle_point_near.py,
returns the nearest point on a triangle in 2D;
-
triangle_quality.py,
returns the shape quality of a triangle in 2D;
-
triangle_reference_sample.py,
randomly samples a point from the reference triangle in 2D;
-
triangle_sample.py,
randomly samples a point from a triangle in 2D;
-
triangle_xsi_to_xy.py,
converts barycentric to cartesian coordinates in a triangle in 2D;
-
triangle_xy_to_xsi.py,
converts cartesian to barycentric coordinates in a triangle in 2D;
-
triangle01_area.py,
returns the area of the unit triangle.
-
triangle01_sample.py,
samples the unit triangle.
-
wedge01_volume.py,
returns the volume of the unit wedge.
Source code:
You can go up one level to
the Python source codes.
Last revised on 07 August 2018.