Skip to content
Back to categories

Geometry

Algorithms that reason about points, lines, shapes, and spaces.

Geometry algorithms answer spatial questions about shape boundaries, intersections, containment, and arrangements.

GeometryO(n log n)

Convex Hull

Finds the smallest convex boundary that contains a set of points.

IntermediateFoundationFormula21 links
GeometryComputational GeometryPolygons
GeometryO(n log n)

Graham Scan

Computes a convex hull by sorting points by angle and keeping valid turns.

IntermediateCoreFormula4 links
GeometryComputational GeometryPolygonsClassic
GeometryO(1)

Line Segment Intersection

Determines whether two line segments cross or touch.

BeginnerFoundationFormula11 links
GeometryComputational Geometry
GeometryO(n)

Point in Polygon

Tests whether a point lies inside a polygon.

BeginnerFoundationFormula5 links
GeometryPolygonsComputational Geometry
GeometryO(n log n)

Delaunay Triangulation

Triangulates points so triangles avoid skinny angles as much as possible.

AdvancedCoreFormula5 links
GeometryTriangulationComputational Geometry
GeometryO(nh)

Jarvis March

Finds a convex hull by wrapping around the outside point by point.

BeginnerCoreFormula4 links
GeometryComputational GeometryPolygons
GeometryO(n log n)

Quickhull

Finds a convex hull by recursively choosing farthest outside points.

IntermediateCoreFormula4 links
GeometryComputational GeometryDivide and Conquer
GeometryO(a v)

Separating Axis Theorem

Tests convex shape overlap by looking for an axis that separates them.

IntermediateCoreFormula3 links
GeometryCollision DetectionComputational Geometry
GeometryO((n + k) log n)

Sweep Line Algorithm

Processes geometric events in sorted order as a line moves across the plane.

AdvancedCoreNo formula6 links
GeometrySweep LineComputational Geometry
GeometryO(n log n)

Voronoi Diagram

Partitions space into regions closest to each input site.

AdvancedCoreFormula9 links
GeometryComputational GeometrySpatial Index
GeometryO(n * m)

Sutherland-Hodgman Polygon Clipping

Clips a polygon against each boundary of a convex clipping region.

IntermediateCoreFormula3 links
GeometryPolygon ClippingPolygonsComputational Geometry
GeometryO((n + k) log n)

Bentley-Ottmann Algorithm

Finds all line segment intersections with a sweep line and event queue.

AdvancedSpecializedFormula4 links
GeometrySweep LineComputational GeometryCollision Detection
GeometryO(n)

Rotating Calipers

Solves convex polygon measurements by rotating supporting lines around the hull.

AdvancedExtendedFormula7 links
GeometryComputational GeometryPolygons
GeometryO(n log n)

Fortune's Algorithm

Constructs a Voronoi diagram with a sweep line and beach line.

AdvancedSpecializedFormula3 links
GeometrySweep LineComputational GeometrySpatial Index
GeometryO(n log n) with spatial search

Bowyer-Watson Algorithm

Builds a Delaunay triangulation by inserting points and retriangulating invalid cavities.

AdvancedSpecializedFormula3 links
GeometryTriangulationComputational Geometry
GeometryO(n log n)

Closest Pair of Points

Finds the two points with the smallest distance between them.

IntermediateExtendedFormula1 links
GeometryComputational GeometryDivide and Conquer
GeometryO(1)

Ray-Triangle Intersection

Finds whether and where a ray hits a triangle.

IntermediateExtendedFormula5 links
GeometryRay IntersectionComputational GeometryGraphics
GeometryO(shape complexity)

Signed Distance Function Evaluation

Computes distance to a shape boundary with sign indicating inside or outside.

IntermediateExtendedFormula2 links
GeometrySigned Distance FieldRay MarchingGraphics
GeometryO(n m)

Weiler-Atherton Polygon Clipping

Clips complex polygons by walking between subject and clipping polygon boundaries at intersections.

AdvancedExtendedNo formula3 links
Computational GeometryPolygon ClippingPolygonsGeometry
GeometryO(n log n)

Minimum Bounding Rectangle

Finds the smallest-area rectangle that encloses a set of points or a convex polygon.

IntermediateCoreFormula3 links
Computational GeometryGeometryPolygonsBounding Volume
GeometryO(1)

Point-Line Distance

Computes the shortest distance from a point to a line.

BeginnerFoundationFormula4 links
Computational GeometryGeometryDistance MetricLinear Algebra
GeometryO(dimensions)

Axis-Aligned Bounding Box Intersection

Tests whether two axis-aligned boxes overlap on every coordinate axis.

BeginnerFoundationFormula6 links
Computational GeometryBounding VolumeCollision DetectionGeometry
GeometryO(1)

Oriented Bounding Box Intersection

Tests overlap between rotated boxes using candidate separating axes.

AdvancedCoreFormula4 links
Computational GeometryBounding VolumeCollision DetectionGeometry
GeometryO(n log n)

Bounding Volume Hierarchy Construction

Builds a tree of bounding volumes around geometry for faster spatial queries.

AdvancedCoreFormula3 links
Computational GeometrySpatial IndexBounding VolumeAcceleration Structure
GeometryO(n + m)

Minkowski Sum

Combines two shapes by adding every point in one shape to every point in the other.

AdvancedExtendedFormula6 links
Computational GeometryGeometryPolygonsCollision Detection
GeometryO(n log n)

Ramer-Douglas-Peucker

Simplifies a polyline by removing points whose deviation is below a tolerance.

IntermediateCoreFormula3 links
Computational GeometryCurve SimplificationGeometryDistance Metric
GeometryO(cells)

Marching Squares

Extracts 2D contour lines from a scalar grid using cell case tables.

IntermediateCoreFormula3 links
Computational GeometrySurface ExtractionGrid SearchGeometry
GeometryO(n^2)

Ear Clipping Triangulation

Triangulates a simple polygon by repeatedly removing valid ears.

IntermediateCoreFormula3 links
Computational GeometryTriangulationPolygonsGeometry
GeometryO(1)

Barycentric Coordinates

Represents a point inside a triangle as weights on the triangle's vertices.

IntermediateCoreFormula4 links
Computational GeometryInterpolationTriangulationLinear Algebra
GeometryO(iterations * (V + E))

Laplacian Mesh Smoothing

Smooths a mesh by moving vertices toward the average of their neighbors.

IntermediateExtendedFormula3 links
Computational GeometryMesh ProcessingSmoothingGeometry
GeometryO(iterations * faces)

Catmull-Clark Subdivision

Refines polygon meshes into smoother subdivision surfaces.

AdvancedExtendedFormula3 links
Computational GeometryMesh ProcessingSurface ExtractionSmoothing
GeometryO(E log E)

Quadric Error Mesh Simplification

Simplifies a mesh by collapsing edges that add the least quadric error.

AdvancedExtendedFormula5 links
Computational GeometryMesh ProcessingCurve SimplificationGeometry
GeometryO(n log n)

Welzl's Minimum Enclosing Circle

Welzl's Minimum Enclosing Circle computes spatial relationships, shapes, or mesh changes from geometric predicates.

IntermediateCoreFormula1 links
GeometryComputational Geometry
GeometryO(n log n)

Andrew's Monotone Chain

Andrew's Monotone Chain computes spatial relationships, shapes, or mesh changes from geometric predicates.

IntermediateCoreFormula1 links
GeometryComputational Geometry
GeometryO(n log n)

Kirkpatrick-Seidel Algorithm

Kirkpatrick-Seidel Algorithm computes spatial relationships, shapes, or mesh changes from geometric predicates.

IntermediateSpecializedNo formula1 links
GeometryComputational Geometry
GeometryO(n log n)

Plane Sweep Closest Pair

Plane Sweep Closest Pair computes spatial relationships, shapes, or mesh changes from geometric predicates.

IntermediateCoreNo formula1 links
GeometryComputational Geometry
GeometryO(n log n)

Point Location in Triangulation

Point Location in Triangulation computes spatial relationships, shapes, or mesh changes from geometric predicates.

IntermediateSpecializedNo formula2 links
GeometryComputational Geometry
GeometryO(n log n)

Polygon Boolean Operations

Polygon Boolean Operations computes spatial relationships, shapes, or mesh changes from geometric predicates.

IntermediateCoreNo formula1 links
GeometryComputational Geometry
GeometryO(n log n)

Voronoi Relaxation

Voronoi Relaxation computes spatial relationships, shapes, or mesh changes from geometric predicates.

IntermediateExtendedNo formula1 links
GeometryComputational Geometry
GeometryO(n log n)

Lloyd's Algorithm

Lloyd's Algorithm computes spatial relationships, shapes, or mesh changes from geometric predicates.

IntermediateCoreFormula1 links
GeometryComputational Geometry
GeometryO(n log n)

Mesh Decimation

Mesh Decimation computes spatial relationships, shapes, or mesh changes from geometric predicates.

IntermediateExtendedNo formula1 links
GeometryComputational Geometry
GeometryO(n log n)

Half-Edge Mesh Traversal

Half-Edge Mesh Traversal computes spatial relationships, shapes, or mesh changes from geometric predicates.

IntermediateExtendedNo formula1 links
GeometryComputational Geometry
GeometryO(1)

Orientation Test

Determines whether three points make a left turn, right turn, or are collinear.

BeginnerFoundationFormula5 links
GeometryComputational GeometryLinear Algebra
GeometryO(1)

In-Circle Test

Tests whether a point lies inside, on, or outside the circumcircle of three oriented points.

IntermediateCoreNo formula4 links
GeometryComputational Geometry
GeometryO(n log n)

Shewchuk Adaptive Predicates

Shewchuk Adaptive Predicates addresses robust geometric predicates by increasing arithmetic precision only when floating-point signs are uncertain.

AdvancedSpecializedNo formula4 links
GeometryComputational Geometry
GeometryO(n log n)

Trapezoidal Map Point Location

Locates a query point in a planar subdivision using a trapezoidal decomposition and search DAG.

IntermediateCoreNo formula4 links
GeometryComputational Geometry
GeometryO(n log n)

Kirkpatrick Point Location

Kirkpatrick Point Location addresses planar point location by building a hierarchy of simplified triangulations for logarithmic queries.

AdvancedSpecializedNo formula3 links
GeometryComputational Geometry
GeometryO(n log n)

Straight Skeleton

Straight Skeleton addresses polygon offset structure by moving polygon edges inward and recording where wavefront events meet.

AdvancedSpecializedNo formula3 links
GeometryComputational Geometry
GeometryO(n log n)

Voronoi-Based Medial Axis

Voronoi-Based Medial Axis addresses medial axis extraction by deriving central shape branches from Voronoi features.

AdvancedSpecializedNo formula5 links
GeometryComputational Geometry
GeometryO(n log n)

Monotone Polygon Partitioning

Monotone Polygon Partitioning uses sweeping vertices to split a polygon into y-monotone pieces for polygon decomposition.

IntermediateCoreNo formula6 links
GeometryComputational Geometry
GeometryO(n log n)

Hertel-Mehlhorn Convex Decomposition

Hertel-Mehlhorn Convex Decomposition addresses convex polygon decomposition by removing unnecessary triangulation diagonals while preserving convex pieces.

IntermediateExtendedNo formula6 links
GeometryComputational Geometry
GeometryO(n log n)

Bayazit Convex Decomposition

Bayazit Convex Decomposition addresses convex polygon decomposition by recursively splitting reflex vertices to create convex parts.

IntermediateExtendedNo formula6 links
GeometryComputational GeometryDivide and Conquer
GeometryO(n log n)

Visvalingam-Whyatt Simplification

Visvalingam-Whyatt Simplification handles polyline simplification by removing points with the smallest effective triangle area.

IntermediateCoreNo formula2 links
GeometryComputational Geometry
GeometryO(n log n)

Hausdorff Distance

Measures the largest nearest-neighbor gap between two point sets or shapes.

IntermediateCoreFormula7 links
GeometryComputational Geometry
GeometryO(n log n)

Frechet Distance

Measures curve similarity while preserving the order of points along each curve.

IntermediateCoreFormula7 links
GeometryComputational Geometry
GeometryO(V^2 E)

Shape Context Matching

Shape Context Matching addresses shape matching by describing points by histograms of relative positions around them.

IntermediateExtendedNo formula5 links
GeometryComputational GeometryMatching
GeometryO(n + m)

Procrustes Analysis

Aligns two point sets by choosing the translation, scale, and rotation that minimize squared error.

IntermediateCoreNo formula3 links
GeometryComputational GeometryStrings
GeometryO(n log n)

Topological Sweep

Topological Sweep addresses line arrangement traversal by sweeping an arrangement by maintaining a topological ordering instead of coordinates.

AdvancedSpecializedNo formula4 links
GeometryComputational Geometry
GeometryO(n log n)

Zone Algorithm

Zone Algorithm addresses line arrangement update by walking the cells crossed by an inserted curve or line.

AdvancedSpecializedNo formula4 links
GeometryComputational Geometry
GeometryO(n log n)

Incremental Line Arrangement Construction

Incremental Line Arrangement Construction addresses line arrangement construction by adding lines one at a time and updating affected cells.

IntermediateExtendedNo formula5 links
GeometryComputational Geometry
GeometryO(n log n)

Constrained Delaunay Triangulation

Constrained Delaunay Triangulation uses building Delaunay-like triangles while preserving required input edges for constrained triangulation.

IntermediateCoreNo formula6 links
GeometryComputational Geometry
GeometryO(n log n)

Power Diagram

Power Diagram addresses weighted voronoi diagram by assigning points by weighted power distance instead of ordinary distance.

IntermediateExtendedNo formula2 links
GeometryComputational Geometry
GeometryO(n log n)

Configuration-Space Obstacle Construction

Configuration-Space Obstacle Construction addresses configuration-space construction by expanding obstacles by the robot shape to convert motion to point navigation.

AdvancedSpecializedNo formula5 links
GeometryComputational Geometry
GeometryO(n log n)

Rotating Calipers Diameter

Finds the farthest pair of points on a convex polygon by scanning antipodal pairs.

IntermediateCoreNo formula5 links
GeometryComputational Geometry
GeometryO(n log n)

Rotating Calipers Width

Rotating Calipers Width addresses polygon width by rotating support lines to find the minimum strip containing a convex polygon.

IntermediateExtendedNo formula5 links
GeometryComputational Geometry
GeometryO(n log n)

Rotating Calipers Antipodal Pairs

Rotating Calipers Antipodal Pairs addresses antipodal pair enumeration by advancing support vertices around a convex polygon.

IntermediateExtendedNo formula5 links
GeometryComputational Geometry
GeometryO(1)

Circle-Line Intersection

Finds where a line crosses, touches, or misses a circle.

IntermediateCoreFormula4 links
GeometryComputational Geometry
GeometryO(1)

Point-to-Segment Distance

Computes the shortest distance from a point to a finite line segment.

IntermediateCoreFormula5 links
GeometryComputational Geometry
GeometryO(n log n)

Orthogonal Range Search

Reports points inside an axis-aligned query rectangle or box.

IntermediateCoreNo formula6 links
GeometryComputational Geometry
GeometryO(n log n)

Polygon Offset Curve

Polygon Offset Curve addresses polygon offsetting by shifting edges and resolving joins to expand or shrink a polygon.

IntermediateExtendedNo formula4 links
GeometryComputational Geometry