**geometry**,
a MATLAB code 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.

Note that I much prefer vectors to be expressed as column vectors; MATLAB, on the other hand, seems to make it easier to work with row vectors. In my original codes, I primarily used row vectors, but I have determined to convert to column vectors; the code is in the middle of this transition, so in some cases there may be be some inconsistencies in style, and accidental inconsistencies in use. On the other hand, I am willing to put up with the practice of declaring a column vector's entries as though they were in a matrix of dimension n by 1, since this guarantees me that, for instance, a dot product is written as (u' * v), and everything finally makes sense to me.

The computer code and data files described and made available on this web page are distributed under the MIT license

**geometry** is available in
a C version and
a C++ version and
a FORTRAN90 version and
a MATLAB version and
a Python version.

delaunay_test, a MATLAB code which calls the MATLAB built-in function delaunay(), which computes the Delaunay triangulation of a set of points.

ellipse, a MATLAB code which carries out geometric calculations for ellipses and ellipsoids, including area, distance to a point, eccentricity, perimeter, points along the perimeter, random sampling, conversion between standard and quadratic forms.

hypersphere, a MATLAB code 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, a MATLAB code which carries out geometric calculations on polygons, including angles, area, centroid, containment of a point, diameter, integrals of monomials, convexity, distance to a point.

quadrilateral, a MATLAB code which carries out geometric calculations on quadrilaterals, including angles, area, distances, nearest point, point containment, perimeter, and random generation.

simplex_coordinates, a MATLAB code which computes the Cartesian coordinates of the vertices of a regular simplex in M dimensions.

sphere_grid, a MATLAB code which provides a number of ways of generating grids of points, or of points and lines, or of points and lines and faces, over the unit sphere.

sphere_stereograph, a MATLAB code which computes the stereographic mapping between points on the unit sphere and points on the plane Z = 1.

tetrahedron, a MATLAB code which carries out geometric calculations involving a general tetrahedron, including solid and facial angles, face areas, point containment, distances to a point, circumsphere and insphere, measures of shape quality, centroid, barycentric coordinates, edges and edge lengths, random sampling, and volumes.

tetrahedrons, a dataset directory which contains examples of tetrahedrons;

triangles, a dataset directory which contains examples of triangles;

triangulate, a MATLAB code which triangulates a (possibly nonconvex) polygon.

triangulation, a MATLAB code which defines and analyzes triangulations.

- angle_box_2d.m, "boxes" an angle defined by three points in 2D;
- angle_contains_point_2d.m, determines if an angle contains a point in 2D;
- angle_deg_2d.m, returns the angle between two rays in 2D, in degrees;
- angle_half.m, returns a ray defining half the angle between two rays;
- angle_rad.m, returns the angle between two rays;
- angle_rad_3d.m, returns the angle between two rays in 3D, in radians;
- angle_rad_nd.m, returns the angle between two rays in ND, in radians;
- angle_turn_2d.m, returns the turning defined by an angle in 2D;
- annulus_area_2d.m, computes the area of a circular annulus;
- annulus_sector_area_2d.m, computes the area of an annulus sector;
- annulus_sector_centroid_2d.m, computes the centroid of an annulus sector;
- ball01_sample_2d.m, picks a random point in the unit ball in 2D;
- ball01_sample_3d.m, picks a random point in the unit ball in 3D;
- ball01_sample_nd.m, picks a random point in the unit ball in ND;
- ball01_volume.m returns the volume of the unit ball in 3D.
- basis_map_3d.m, computes the matrix which maps one basis to another in 3D;
- boolean_to_string.m, returns "True" or "False", given a boolean value.
- box_contains_point_2d.m, is TRUE if a point is contained in a box in 2D;
- box_contains_point_nd.m, is TRUE if a point is contained in a box in ND;
- box_contains_segment_nd.m, is TRUE if a line segment is contained in a box in ND;
- box_ray_int_2d.m, determines where a ray inside a box intersects the box boundary in 2D;
- box_segment_clip_2d.m, uses a box to clip a line in 2D;
- box01_contains_point_2d.m, is TRUE if a point is contained in a unit box in 2D;
- box01_contains_point_nd.m, is TRUE if a point is contained in a unit box in ND;
- circle_arc_point_near_2d.m, returns the nearest circle arc point to a point in 2D;
- circle_area_2d.m, returns the area of a circle in 2D;
- circle_dia2imp_2d.m, converts a diameter to an implicit circle in 2D;
- circle_exp_contains_point_2d.m, finds if an explicit circle contains a point in 2D;
- circle_exp2imp_2d.m, converts an explicit circle to an implicit circle in 2D;
- circle_imp_contains_point_2d.m, finds if an implicit circle contains a point in 2D;
- circle_imp_line_exp_dist_2d.m, distance ( implicit circle, explicit line ) in 2D;
- circle_imp_line_exp_intersect.m, circle_imp_line_exp_intersect: ( imp circle, exp line ) intersection;
- circle_imp_line_par_int_2d.m, finds intersections of an implicit circle and a parametric line in 2D;
- circle_imp_point_dist_2d.m, finds the distance from a point to an implicit circle in 2D;
- circle_imp_point_dist_signed_2d.m, finds the signed distance from a point to an implicit circle in 2D;
- circle_imp_point_near_2d.m, finds the nearest implicit circle point to a point in 2D;
- circle_imp_points.m, returns points on an implicit circle;
- circle_imp_points_3d.m, returns points on an implicit circle in 3D;
- circle_imp_points_arc.m, returns points on an implicit circular arc;
- circle_imp_print_2d.m, prints information about an implicit circle in 2D;
- circle_imp_print_3d.m, prints information about an implicit circle in 3D;
- circle_imp_segment_intersect.m, ( imp circle, line segment ) intersection;
- circle_imp2exp_2d.m, converts an implicit circle to an explicit circle in 2D;
- circle_llr2imp_2d.m, converts a circle in LLR format to an implicit circle in 2D.
- circle_lune_angle_by_height_2d.m, computes the angle of a circular lune using the triangle height;
- circle_lune_area_by_angle_2d.m, computes the area of a circular lune using the subtended angle;
- circle_lune_area_by_height_2d.m, computes the area of a circular lune using the triangle height;
- circle_lune_centroid_2d.m, returns the centroid of a circular lune in 2D;
- circle_lune_height_by_angle_2d.m, computes the triangle height of a circular lune using the subtended angle;
- circle_pppr2imp_3d converts a circle from PPPR to implicit form in 3D.
- circle_ppr2imp_2d.m, converts a circle from PPR form into implicit form in 2D;
- circle_sector_area_2d.m, returns the area of a circle sector in 2D;
- circle_sector_centroid_2d.m, returns the centroid of a circle sector in 2D;
- circle_sector_contains_point_2d.m, reports if a circle sector contains a point in 2D.
- circle_sector_print_2d.m, prints information about a circle sector in 2D.
- circle_triangle_area_2d.m, returns the area of a circle triangle in 2D;
- circle_triple_angles_2d.m, returns the angles formed by three cotangent circles in 2D.
- circles_intersect_area_2d.m, finds the area of the intersection of two circles.
- circles_intersect_points_2d.m, finds intersection points of two circles;
- cone_area_3d.m, returns the surface area of a cone in 3D;
- cone_centroid_3d.m, returns the centroid of a cone in 3D;
- cone_volume.m, returns the volume of a cone;
- conv3d.m, uses a simple project to map 3D data to 2D;
- convex_hull.m, computes the convex hull of a set of points in 2D;
- cot_rad.m, returns the cotangent of an angle given in radians;
- cube_shape.m, returns shape information for a cube;
- cube_size.m, returns "sizes" for a cube;
- cylinder_point_dist.m, returns the distance from a point to a cylinder;
- cylinder_point_dist_signed.m, returns the signed distance from a point to a cylinder;
- cylinder_point_inside.m, reports whether a point is inside a cylinder;
- cylinder_point_near.m, returns the nearest point on a cylinder;
- cylinder_sample.m, returns sample points from a cylinder;
- cylinder_volume.m, returns the volume of a cylinder;
- degrees_to_radians.m, converts an angle in degrees to one in radians;
- direction_pert_2d.m, randomly perturbs a direction vector in 2D;
- direction_uniform_2d.m, generates a random direction vector in 2D;
- direction_uniform_3d.m, generates a random direction vector in 3D;
- direction_uniform_nd.m, generates a random direction vector in ND;
- disk_point_dist_3d.m, finds the distance from a point to a disk in 3D;
- dms_to_radians.m, converts from degrees/minutes/seconds to radians;
- dodec_size.m, returns "sizes" for a dodecahedron;
- dodec_shape.m, returns shape information for a dodecahedron;
- dual_shape.m, returns information for the dual of a shape;
- dual_size.m, returns "sizes" for the dual of a shape;
- glob2loc_3d.m, converts from a global to local coordinate system in 3D;
- halfplane_contains_point_2d.m, reports if a half-plane contains a point in 2D;
- halfspace_imp_triangle_int_3d.m, finds the intersection of an implicit halfspace with a triangle in 3D;
- halfspace_normal_triangle_int_3d.m, finds the intersection of a normal halfspace with a triangle in 3D;
- halfspace_triangle_int_3d.m, finds the intersection of a halfspace with a triangle in 3D;
- helix_shape_3d.m, computes point on a helix in 3D;
- hexagon_area_2d.m, returns the area of a hexagon in 2D;
- hexagon_contains_point_2d.m, reports whether a hexagon contains a point;
- hexagon01_area_2d.m, returns the area of a unit hexagon in 2D;
- hexagon01_shape_2d.m, returns a point on the unit hexagon in 2D, specified by angle;
- hexagon01_vertices.m, returns the vertices of a unit hexagon;
- hyperball01_volume.m, returns the volume of the unit hyperball.
- hyperball01_volume_pnorm.m, returns the volume of the unit hyperball under the LP norm.
- i4_dedekind_factor.m, computes a function needed for a Dedekind sum;
- i4_dedekind_sum.m, computes the Dedekind sum of two I4's.
- i4_factorial2.m, evaluates the double factorial function;
- i4_modp.m, returns the nonnegative remainder of integer division;
- i4_swap.m, swaps two integer values;
- i4_wrap.m, forces an integer to lie in a given range;
- i4col_compare.m, compares two columns of an I4COL;
- i4col_find_item.m, searches for a given value in an I4COL;
- i4col_find_pair_wrap.m, wrap-searches a table by columns for a pair of values;
- i4col_sort_a.m, ascending sorts the columns of an I4COL;
- i4col_sorted_unique_count.m, counts the unique columns in a sorted I4COL;
- i4col_swap.m, swaps two columns of an I4COL;
- i4mat_print.m, prints an integer matrix;
- i4mat_print_some.m, prints some of an integer matrix;
- i4mat_transpose_print.m, prints an integer matrix, transposed;
- i4mat_transpose_print_some.m, prints some of an integer matrix, transposed;
- i4row_compare.m, compares two rows of an integer array;
- i4row_sort_a.m, ascending sorts the rows of an integer array;
- i4row_swap.m, swaps two rows of an integer array;
- i4vec_heap_d.m, reorders an I4VEC into a descending heap;
- i4vec_indicator1.m, sets an I4VEC to the indicator1 vector;
- i4vec_lcm.m, returns the least common multiple of an I4VEC;
- i4vec_print.m, prints an I4VEC;
- i4vec_print_some.m, prints some of an I4VEC;
- i4vec_sort_heap_a.m, ascending sorts an I4VEC using heap sort;
- i4vec_sorted_unique.m, returns the unique elements in a sorted I4VEC;
- i4vec2_compare.m, compares pairs of integers stored in two vectors;
- i4vec2_sort_a.m, ascending sorts a pair of I4VEC's;
- i4vec2_sorted_unique.m, finds unique elements in a sorted IVEC2.
- icos_size.m, gives "sizes" for an icosahedron;
- icos_shape.m, describes an icosahedron;
- line_exp_is_degenerate_nd.m, determines if an explicit line is degenerate in ND;
- line_exp_normal.m, computes the unit normal to an explicit line;
- line_exp_perp_2d.m, returns a line perpendicular to an explicit line in 2D;
- line_exp_point_dist.m, returns the distance from a point to an explicit line;
- line_exp_point_dist_3d.m, returns the distance from a point to an explicit line in 3D;
- line_exp_point_dist_signed.m, returns the signed distance from a point to an explicit line;
- line_exp_point_near_2d.m, returns the nearest point on an explicit line in 2D;
- line_exp_point_near_3d.m, returns the nearest point on an explicit line in 3D;
- line_exp_print_2d.m, prints an explicit line in 2D;
- line_exp2imp_2d.m, converts an explicit line to an implicit line in 2D;
- line_exp2par_2d.m, converts an explicit line to a parametric line in 2D;
- line_exp2par_3d.m, converts an explicit line to a parametric line in 3D;
- line_imp_is_degenerate_2d.m, determines if an implicit line is degenerate in 2D;
- line_imp_point_dist_2d.m, returns the distance from a point to an implicit line in 2D;
- line_imp_point_dist_signed_2d.m, returns the signed distance from a point to an implicit line in 2D;
- line_imp2exp_2d.m, converts an implicit to explicit line in 2D;
- line_imp2par_2d.m, converts an implicit to parametric line in 2D;
- line_par_point_dist_2d.m, returns the distance from a point to a parametric line in 2D;
- line_par_point_dist_3d.m, returns the distance from a point to a parametric line in 3D;
- line_par_point_near_2d.m, returns the nearest point on a parametric line to a point in 2D;
- line_par_point_near_3d.m, returns the nearest point on a parametric line to a point in 3D;
- line_par2exp_2d.m, converts a parametric to explicit line in 2D;
- line_par2exp_3d.m, converts a parametric to explicit line in 3D;
- line_par2imp_2d.m, converts a parametric to implicit line in 2D;
- lines_exp_angle_3d.m, finds the angle between explicit lines in 3D;
- lines_exp_angle_nd.m, finds the angle between explicit lines in ND;
- lines_exp_dist_3d.m, finds the distance between explicit lines in 3D;
- lines_exp_dist_3d_2.m, finds the distance between explicit lines in 3D;
- lines_exp_equal_2d.m, determines if two explicit lines are equal in 2D.
- lines_exp_int_2d.m, finds the intersection of two explicit lines in 2D;
- lines_exp_near_3d.m, finds the nearest points on two explicit lines in 3D;
- lines_exp_parallel_2d.m, finds if two explicit lines in 2D are parallel;
- lines_exp_parallel_3d.m, finds if two explicit lines in 3D are parallel;
- lines_imp_angle_2d.m, finds the angle between two implicit lines in 2D;
- lines_imp_dist_2d.m, finds the distance between two implicit lines in 2D;
- lines_imp_int_2d.m, finds the intersection of two implicit lines in 2D;
- lines_par_angle_2d.m, finds the angle between parametric lines in 2D;
- lines_par_angle_3d.m, finds the angle between parametric lines in 3D;
- lines_par_dist_3d.m, finds the distance between parametric lines in 3D;
- lines_par_int_2d.m, finds the intersection of two parametric lines in 2D;
- loc2glob_3d.m, converts from a local to global coordinate system in 3D;
- minabs.m, minimizes Y = A * |X| + B in an interval;
- minquad.m, minimizes Y = A * X * X + B * X + C in an interval;
- octahedron_shape.m, returns shape information for an octahedron;
- octahedron_size.m, returns size information for an octahedron;
- parabola_ex.m, finds the extremal point of a parabola determined by three values;
- parabola_ex2.m, finds the extremal point of a parabola determined by three values;
- parallelogram_area.m, computes the area of a parallelogram;
- parallelogram_area_3d.m, computes the area of a parallelogram in 3D;
- parallelogram_contains_point_2d.m, checks whether a point is contained in a parallelogram in 2D;
- parallelogram_contains_point_3d.m, checks whether a point is contained in a parallelogram in 3D;
- parallelogram_point_dist_3d.m, finds the distance to a parallelogram in 3D;
- parallelepiped_contains_point_3d.m, reports if a point is inside a parallelepiped in 3D;
- parallelepiped_point_dist_3d.m, finds the distance to a parallelepiped in 3D;
- plane_exp_grid_3d.m, computes points and lines making a grid on an explicit plane in 3D;
- plane_exp_normal.m, finds the normal to an explicit plane;
- plane_exp_point_dist_3d.m, finds the distance between a point and an explicit plane in 3D;
- plane_exp_pro2.m, produces the in-plane coordinates of points on an explicit plane in 3D;
- plane_exp_pro3.m, projects points orthographically onto an explicit plane in 3D;
- plane_exp_project.m, projects points through a point and onto an explicit plane;
- plane_exp2imp_3d.m, converts a plane from explicit to implicit form in 3D;
- plane_exp2normal_3d.m, converts a plane from explicit to normal form in 3D;
- plane_imp_is_degenerate_3d.m, is true if an implicit plane in 3D is degenerate;
- plane_imp_line_par_int_3d.m, determines if an implicit plane and a parametric line intersect in 3D;
- plane_imp_point_dist_3d.m, determines the distance to an implicit plane in 3D;
- plane_imp_point_dist_signed_3d.m, determines the signed distance to an implicit plane in 3D;
- plane_imp_point_near_3d.m, determines the nearest point on an implicit plane in 3D;
- plane_imp_segment_near_3d.m, finds the nearest points on an implicit plane and a line segment in 3D;
- plane_imp_triangle_int_3d.m, finds intersections of an implicit plane and a triangle in 3D;
- plane_imp_triangle_int_add_3d.m, a utility for triangle/plane intersections in 3D;
- plane_imp_triangle_near_3d.m, finds nearest points on an implicit plane and a triangle in 3D;
- plane_imp2exp_3d.m, converts a plane from implicit to explicit form in 3D;
- plane_imp2normal_3d.m, converts a plane from implicit to normal form in 3D;
- plane_normal_basis_3d.m, finds two perpendicular vectors in a plane in normal form in 3D;
- plane_normal_line_exp_3d.m, determines where an explicit line intersects a plane in normal form in 3D;
- plane_normal_qr_to_xyz.m, converts from QR to XYZ coordinates in a normal plane;
- plane_normal_tetrahedron_intersect.m, finds intersections of a normal plane and a tetrahedron;
- plane_normal_triangle_int_3d.m, finds intersections of a normal plane and a triangle in 3D;
- plane_normal_uniform_3d.m, chooses a normal plane at random in 3D;
- plane_normal_uniform_nd.m, chooses a normal plane at random in ND;
- plane_normal_xyz_to_qr.m, converts from XYZ_TO_QR coordinates in a normal plane;
- plane_normal2exp_3d.m, converts a plane from normal to explicit form in 3D;
- plane_normal2imp_3d.m, converts a plane from normal to implicit form in 3D;
- planes_imp_angle_3d.m, finds the dihedral angle between implicit planes in 3D;
- points_avoid_point_naive_2d.m, is a point "far enough" from a set of points in 2D?;
- points_bisect_line_imp_2d.m, implicit bisector line between two points in 2D;
- points_bisect_line_par_2d.m, parametric bisector line between two points in 2D;
- points_centroid_2d.m, computes the discrete centroid of a point set in 2D;
- points_colin_2d.m, estimates the colinearity of 3 points in 2D;
- points_colin_3d.m, estimates the colinearity of 3 points in 3D;
- points_dist_nd.m, returns the distance between two points in ND;
- points_plot.m, makes an EPS plot of a set of points;
- points_point_near_naive_nd.m, finds the nearest of a set of points to a point in ND;
- polar_to_xy.m, converts polar coordinates to XY coordinates;
- polygon_area.m, computes the area of a polygon;
- polygon_area_3d.m, computes the area of a polygon in 3D;
- polygon_centroid_3d.m, computes the centroid of a polygon in 3D;
- polygon_normal_3d.m, finds the normal vector for a (planar) polygon in 3D;
- polygon_solid_angle_3d.m, determines the solid angle subtended by a polygon with respect to a unit sphere around a given point in 3D;
- polyhedron_area_3d.m, computes the surface area of a polyhedron in 3D;
- polyhedron_centroid_3d.m, computes the centroid of a polyhedron in 3D;
- polyhedron_contains_point_3d.m, determines if a point is inside a polyhedron in 3D;
- polyhedron_volume_3d.m, computes the volume of a polyhedron in 3D;
- polyhedron_volume_3d_2.m, computes the volume of a polyhedron in 3D;
- polyline_arclength_nd.m, returns the arclength of points on a polyline in ND;
- polyline_index_point_nd.m, returns the point with given arclength on a polyline in ND;
- polyline_length_nd.m, returns the length of a polyline in ND;
- polyline_points_nd.m, returns equally spaced points on a polyline in ND;
- polyloop_arclength_nd.m, returns the arclength of points on a polyloop in ND;
- polyloop_length_nd.m, returns the length of a polyloop in ND;
- polyloop_points_nd.m, returns equally spaced points on a polyloop in ND;
- provec.m, projects a vector from an M dimensional space to an N dimensional space;
- pyramid_volume_3d.m, returns the volume of a pyramid in 3D;
- pyramid01_volume_3d.m, returns the volume of the unit pyramid in 3D;
- quadrilateral_angles.m, returns the angles of a quadrilateral;
- quadrilateral_area.m, returns the area of a quadrilateral;
- quadrilateral_area2.m, returns the area of a quadrilateral;
- quadrilateral_area_3d.m, returns the area of a quadrilateral in 3D;
- quadrilateral_contains_point.m, finds if a point is inside a convex quadrilateral;
- quadrilateral_convex_random.m, returns a random convex quadrilateral inside the unit square.
- quadrilateral_is_convex.m, returns TRUE if a quadrilateral is convex.
- quadrilateral_is_simple.m, is TRUE is a quadrilateral is "simple", that is, non-degenerate;
- quadrilateral_perimeter.m, computes the length of the perimeter of a quadrilateral;
- quadrilateral_point_dist.m, finds the distance from a point to a quadrilateral;
- quadrilateral_point_dist_signed.m, finds the signed distance from a point to a quadrilateral;
- quadrilateral_point_near_2d.m, finds the nearest point on a quadrilateral in 2D;
- quadrilateral_random.m, returns a random quadrilateral;
- quadrilateral_simple_random.m, returns a random simple quadrilateral;
- r8_cosd.m, returns the cosine of an angle given in degrees;
- r8_haversine.m, returns the haversine of an angle;
- r8_modp.m, returns the positive remainder of R8 division;
- r8_sign.m, returns the sign of an R8;
- r8_sign_opposite_strict.m, is TRUE if two R8's have strictly opposite signs.
- r8_sind.m, returns the sine of an angle given in degrees;
- r8_swap.m, swaps two R8's;
- r8_tand.m, returns the tangent of an angle given in degrees;
- r82vec_part_quick_a.m, ascending partitions an R82VEC as part of a quicksort;
- r82vec_permute.m, permutes an R82VEC in place;
- r82vec_print.m, prints an R82VEC;
- r82vec_sort_heap_index_a.m, does an indexed heap ascending sort of an R82VEC;
- r82vec_sort_quick_a.m, ascending quicksorts an R82VEC;
- r8ge_det.m, computes the determinant of an R8GE matrix;
- r8ge_fa.m, factors an R8GE matrix;
- r8ge_sl.m, solves a linear system associated with an R8GE matrix;
- r8mat_det_2d.m, computes the determinant of a 2 by 2 matrix;
- r8mat_det_3d.m, computes the determinant of a 3 by 3 matrix;
- r8mat_det_4d.m, computes the determinant of a 4 by 4 matrix;
- r8mat_det_5d.m, computes the determinant of a 5 by 5 matrix;
- r8mat_inverse_2d.m, computes the inverse of a 2 by 2 matrix;
- r8mat_inverse_3d.m, computes the inverse of a 3 by 3 matrix;
- r8mat_print.m, prints an R8MAT;
- r8mat_print_some.m, prints some of an R8MAT;
- r8mat_solve_2d.m, solves a 2 by 2 system using Cramer's rule.
- r8mat_transpose_print.m, prints the transpose of an R8MAT;
- r8mat_transpose_print_some.m, prints some of the transpose of an R8MAT;
- r8vec_angle_3d.m, computes the angle between two vectors in 3D;
- r8vec_any_normal.m, returns a unit normal vector to a given vector;
- r8vec_bracket.m, searches a sorted R8VEC for brackets of a value;
- r8vec_cross_product_2d.m, computes the cross product of two R8VEC's in 2D;
- r8vec_cross_product_affine_2d.m, computes the affine cross product of two R8VEC's in 2D;
- r8vec_cross_product_3d.m, computes the cross product of two R8VEC's in 3D;
- r8vec_cross_product_affine_3d.m, computes the affine cross product of two R8VEC's in 3D;
- r8vec_distance.m, returns the distance between two R8VEC's;
- r8vec_dot_product.m, computes the dot product of two R8VEC's;
- r8vec_dot_product_affine.m, computes the affine dot product of two R8VEC's;
- r8vec_eq.m, is true if two R8VEC's are equal;
- r8vec_gt.m, is true if one R8VEC is greater than another;
- r8vec_lt.m, is true if one R8VEC is less than another;
- r8vec_normal_01.m, returns a unit pseudonormal R8VEC;
- r8vec_normsq.m, returns the squared L2 norm of an R8VEC.
- r8vec_normsq_affine.m, returns the squared affine L2 norm of an R8VEC.
- r8vec_print.m, prints an R8VEC;
- r8vec_scalar_triple_product.m, computes the scalar triple product;
- r8vec_swap.m, swaps two R8VEC's;
- r8vec3_print.m, prints three R8VEC's together;
- radec_distance_3d.m, angular distance, astronomical units, sphere in 3D;
- radec_to_xyz.m, converts right ascension/declination to XYZ coordinates;
- radians_to_degrees.m, converts an angle in radians to one in degrees;
- radians_to_dms.m, converts an angle in radians to one in degrees/minutes/seconds;
- rd.m computes an incomplete elliptic integral of the second kind, RD(X,Y,Z).
- rf.m computes an incomplete elliptic integral of the first kind, RF(X,Y,Z).
- rotation_axis_vector_3d.m, rotates a vector about an axis vector in 3D;
- rtp_to_xyz.m, converts (R,Theta,Phi) coordinates to XYZ coordinates;
- segment_contains_point_1d.m, determines if a point is contained in a line segment in 1D;
- segment_contains_point_2d.m, determines if a point is contained in a line segment in 2D;
- segment_point_coords_2d.m, computes the "coordinates" of a point relative to a line segment in 2D;
- segment_point_coords_3d.m, computes the "coordinates" of a point relative to a line segment in 3D;
- segment_point_dist.m, computes the distance between a point and a line segment;
- segment_point_dist_3d.m, computes the distance between a point and a line segment in 3D;
- segment_point_near.m, returns the nearest line segment point to a point;
- segment_point_near_3d.m, returns the nearest line segment point to a point in 3D;
- segments_curvature_2d.m, returns the curvature between two line segments in 2D;
- segments_dist_2d.m, returns the distance between two line segments in 2D;
- segments_dist_3d.m, returns the distance between two line segments in 3D;
- segments_int_1d.m, returns the intersection of two line segments in 1D;
- segments_int_2d.m, returns the intersection of two line segments in 2D;
- shape_point_dist_2d.m, computes the distance between a regular shape and a point in 2D;
- shape_point_near_2d.m, computes the nearest point on a regular shape in 2D;
- shape_print.m, prints information about a shape in 3D;
- shape_ray_int_2d.m, finds the intersection of a regular shape and an internal ray in 2D;
- simplex_lattice_layer_point_next.m, returns the next simplex lattice layer point;
- simplex_lattice_point_next.m, returns the next simplex lattice point;
- simplex_volume_nd.m, returns the volume of a simplex in ND;
- simplex01_lattice_point_num_nd.m, counts lattice points in the unit simplex in ND;
- simplex01_volume_nd.m, returns the volume of the unit simplex in ND;
- sin_power_int.m, evaluates the sine power integral;
- soccer_shape.m, gives information for a soccer ball (truncated icosahedron);
- soccer_size.m, gives "sizes" for a soccer ball (truncated icosahedron);
- sort_heap_external.m, externally sorts a list of values into ascending order;
- sphere_cap_area_2d.m, computes the area of a sphere cap in 2D;
- sphere_cap_area_3d.m, computes the area of a sphere cap in 3D;
- sphere_cap_area_nd.m, computes the area of a sphere cap in ND;
- sphere_cap_volume_2d.m, computes the volume of a sphere cap in 2D;
- sphere_cap_volume_3d.m, computes the volume of a sphere cap in 3D;
- sphere_cap_volume_nd.m, computes the volume of a sphere cap in ND;
- sphere_dia2imp_3d.m, converts a diameter to an implicit sphere in 3D;
- sphere_distance_xyz.m, computes great circle distances on a sphere.
- sphere_distance1.m, computes the distance between two points on a sphere;
- sphere_distance2.m, computes the distance between two points on a sphere;
- sphere_distance3.m, computes the distance between two points on a sphere;
- sphere_exp_contains_point_3d.m, reports if a point is inside an explicit sphere in 3D;
- sphere_exp_point_near_3d.m, finds the nearest point on an explicit sphere in 3D;
- sphere_exp2imp_3d.m, converts an explicit to implicit sphere in 3D;
- sphere_exp2imp_nd.m, converts an explicit to implicit sphere in ND, that is, it finds an N-dimensional sphere through N+1 points.
- sphere_imp_area_3d.m, computes the area of an implicit sphere in 3D;
- sphere_imp_area_nd.m, computes the area of an implicit sphere in ND;
- sphere_imp_contains_point_3d.m, determines if a point is inside an implicit sphere in 3D;
- sphere_imp_gridfaces_3d.m, produces a grid of triangles on an implicit sphere in 3D;
- sphere_imp_line_project_3d.m, projects a line onto an implicit sphere in 3D;
- sphere_imp_local2xyz_3d.m, converts local to XYZ coordinates on an implicit sphere in 3D;
- sphere_imp_point_near_3d.m, given a point, finds the nearest point on an implicit sphere in 3D;
- sphere_imp_point_project_3d.m, projects a point onto an implicit sphere in 3D;
- sphere_imp_volume_3d.m, computes the volume of an implicit sphere in 3D;
- sphere_imp_volume_nd.m, computes the volume of an implicit sphere in ND;
- sphere_imp_zone_area_3d.m, computes the area of zone of an implicit sphere in 3D;
- sphere_imp_zone_volume_3d.m, computes the volume of zone of an implicit sphere in 3D;
- sphere_imp2exp_3d.m, converts an implicit to explicit sphere in 3D;
- sphere_k.m, computes a factor useful for certain spherical calculations;
- sphere_polygon_area_3d.m, computes the area of a spherical polygon;
- sphere01_area_nd.m, returns the area of a unit sphere in ND;
- sphere01_area_values.m, returns some areas of a unit sphere in ND;
- sphere01_sample_2d.m, returns a random point in a sphere in 2D;
- sphere01_sample_3d.m, returns a random point in a sphere in 3D;
- sphere01_sample_3d_2.m, a BAD method for returning a random point in a sphere in 3D;
- sphere01_sample_nd.m, returns a random point in a sphere in ND;
- sphere01_sample2_nd.m, returns a random point in a sphere in ND;
- sphere01_sample3_nd.m, returns a random point in a sphere in ND;
- sphere01_volume_nd.m, computes the volume of a unit sphere in ND;
- sphere01_volume_values.m, returns some volumes of a unit sphere in ND;
- sphere01_distance_xyz.m, computes great circle distances on a unit sphere.
- sphere_triangle_angles_to_area.m, computes the area of a spherical triangle;
- sphere_triangle_sides_to_angles.m, computes the angles of a spherical triangle from its sides;
- sphere_triangle_vertices_to_angles.m, computes the angles of a spherical triangle from its vertices;
- sphere_triangle_vertices_to_area.m, computes the area of a spherical triangle from its vertices;
- sphere_triangle_vertices_to_centroid.m, computes the centroid of a spherical triangle from its vertices;
- sphere_triangle_vertices_to_orientation.m, attempts to define an orientation for a spherical triangle from its vertices;
- sphere_triangle_vertices_to_sides.m, computes the sides of a spherical triangle from its sides;
- sphere01_triangle_angles_to_area.m, computes the area of a spherical triangle on a unit sphere.
- sphere01_triangle_sides_to_angles.m, computes the angles of a spherical triangle from its sides on a unit sphere.
- sphere01_triangle_vertices_to_angles.m, computes the angles of a spherical triangle from its vertices on a unit sphere.
- sphere01_triangle_vertices_to_area.m, computes the area of a spherical triangle from its vertices on a unit sphere.
- sphere01_triangle_vertices_to_centroid.m, computes the centroid of a spherical triangle from its vertices on a unit sphere.
- sphere01_triangle_vertices_to_sides.m, computes the sides of a spherical triangle from its sides on a unit sphere.
- string_2d.m, groups line segments into connected lines in 2D;
- super_ellipse_points_2d.m, returns points on a superellipse in 2D;
- tetrahedron_barycentric.m, returns the barycentric coordinates of a point with respect to a tetrahedron;
- tetrahedron_centroid.m, returns the centroid of a tetrahedron;
- tetrahedron_circumsphere.m, returns the circumsphere of a tetrahedron;
- tetrahedron_volume.m, computes the volume of a tetrahedron;
- tmat_init.m, initializes a transformation matrix to the identity;
- tmat_mxm.m, multiplies two transformation matrices;
- tmat_mxp.m, multiplies a transformation matrix times a physical point;
- tmat_mxp2.m, multiplies a transformation matrix times a number of physical points;
- tmat_mxv.m, multiplies a transformation matrix times a vector;
- tmat_rot_axis.m, applies a coordinate axis rotatition to a transformation matrix;
- tmat_rot_vector.m, applies an arbitrary rotation to a transformation matrix;
- tmat_scale.m, applies a scaling to a transformation matrix;
- tmat_shear.m, applies a shear to a transformation matrix;
- tmat_trans.m, applies a translation to a transformation matrix;
- torus_area_3d.m, returns the area of a torus in 3D;
- torus_volume_3d.m, returns the volume of a torus in 3D;
- tp_to_xyz.m, converts unit spherical coordinates to XYZ coordinates;
- triangle_angles_2d.m, returns the angles of a triangle in 2D;
- triangle_angles_3d.m, returns the angles of a triangle in 3D;
- triangle_area.m, returns the area of a triangle;
- triangle_area_3d.m, returns the area of a triangle in 3D;
- triangle_area_3d_2.m, returns the area of a triangle in 3D;
- triangle_area_3d_3.m, returns the area of a triangle in 3D;
- triangle_area_heron.m, returns the area of a triangle in any dimension;
- triangle_area_vector_3d.m, returns the area vector of a triangle in 3D;
- triangle_barycentric.m, returns the barycentric coordinates of a point in a triangle;
- triangle_centroid.m, returns the centroid of a triangle;
- triangle_centroid_3d.m, returns the centroid of a triangle in 3D;
- triangle_circumcenter.m, returns the circumcenter of a triangle;
- triangle_circumcenter_2.m, returns the circumcenter of a triangle;
- triangle_circumcenter_nd.m, returns the circumcenter of a triangle in ND;
- triangle_circumcircle.m, returns the circumcenter of a triangle;
- triangle_circumcircle_2.m, returns the circumcenter of a triangle;
- triangle_circumradius.m, returns the circumradius of a triangle;
- triangle_contains_line_exp_3d.m, determines if an explicit line passes through a triangle in 3D;
- triangle_contains_line_par_3d.m, determines if a parametric line passes through a triangle in 3D;
- triangle_contains_point_2d_1.m, determines if a point is in a triangle in 2D;
- triangle_contains_point_2d_2.m, determines if a point is in a triangle in 2D;
- triangle_contains_point_2d_3.m, determines if a point is in a triangle in 2D;
- triangle_diameter.m, returns the diameter of a triangle;
- triangle_edge_length_2d.m, returns the edge lengths of a triangle in 2D;
- triangle_gridpoints.m, computes gridpoints within a triangle;
- triangle_incenter.m, returns the incenter of a triangle;
- triangle_incircle.m, returns the incircle of a triangle;
- triangle_inradius.m, returns the inradius of a triangle;
- triangle_is_degenerate_nd.m, determines if a triangle is degenerate in ND;
- triangle_lattice_layer_point_next.m, next triangle lattice layer point;
- triangle_lattice_point_next.m, returns the next triangle lattice point;
- triangle_line_imp_int_2d.m, finds intersections of an implicit line with a triangle in 2D;
- triangle_orientation.m, returns the orientation of a triangle;
- triangle_orthocenter_2d.m, returns the orthocenter of a triangle in 2D;
- triangle_point_dist_2d.m, returns the distance of point to a triangle in 2D;
- triangle_point_dist_3d.m, returns the distance of point to a triangle in 3D;
- triangle_point_dist_signed_2d.m, returns the signed distance of point to a triangle in 2D;
- triangle_point_near_2d.m, returns the nearest point on a triangle in 2D;
- triangle_quality_2d.m, returns the shape quality of a triangle in 2D;
- triangle_right_lattice_point_num_2d.m, counts lattice points;
- triangle_sample.m, randomly samples a point from a triangle;
- triangle_unit_lattice_point_num_2d.m, counts lattice points;
- triangle_xsi_to_xy.m, converts barycentric to cartesian coordinates in a triangle;
- triangle_xy_to_xsi.m, converts cartesian to barycentric coordinates in a triangle;
- truncated_octahedron_shape_3d.m, returns shape information for a truncated octahedron in 3D;
- truncated_octahedron_size_3d.m, gives "sizes" for a truncated octahedron in 3D;
- tube_2d.m, constructs a "tube" of given width around a path in 2D;
- tuple_next2.m, returns the next element of an integer tuple sequence;
- tuple_next2_test.m
- vector_directions_nd.m, returns the direction angles of a vector in ND;
- vector_rotate_2d.m, rotates a vector in 2D;
- vector_rotate_3d.m, rotates a vector in 3D;
- vector_rotate_base_2d.m, rotates a vector around a base point in 2D;
- vector_separation_nd.m, finds the angular separation between two vectors in ND;
- vector_unit_nd.m, normalizes a vector in ND;
- voxels_dist_l1_nd.m, finds the L1 distance between voxels in ND;
- voxels_line_3d.m, produces voxels along a line in 3D;
- voxels_region_3d.m, arranges contiguous voxels into regions in 3D;
- voxels_step_3d.m, produces voxels along a line from a given point in 3D;
- wedge01_volume.m returns the volume of the unit wedge.
- xy_to_polar.m, converts XY coordinates to polar coordinates;
- xyz_to_radec.m, converts XYZ coordinates to right ascension and declension;
- xyz_to_rtp.m, converts XYZ coordinates to (R,Theta,Phi) coordinates;
- xyz_to_tp.m, converts XYZ coordinates to (Theta,Phi) coordinates;