Short answer: Welzl’s algorithm computes the smallest enclosing disk of a finite planar point set. It is incremental and randomized. The recursive call returns the smallest disk of a subset, defined by at most three boundary points. A point that falls outside that disk is moved onto the boundary…
Category: Geometry
How the Graham scan builds a convex hull
Short answer: The Graham scan computes the convex hull of a finite set of points in the plane. It anchors the lowest point, sorts the rest by polar angle around that anchor, and walks the sorted list with a stack. A right turn, or a non-left turn, pops the…
How the closest pair of points searches a strip
Short answer: The closest pair algorithm finds the minimum Euclidean distance in a planar set by divide and conquer. It sorts by x, splits the set in half, solves both halves, and then checks only the points that lie in a strip of width δ around the cut, where…
How rotating calipers walk antipodal pairs
Short answer: Rotating calipers compute the diameter, the width, and several other extents of a convex polygon by walking two parallel supporting lines around the boundary. The lines start on an antipodal pair, often the leftmost and rightmost vertices, and the one that can rotate less before it hits…
How ray casting tests a point in a polygon
Short answer: Ray casting decides whether a point lies inside a simple polygon by shooting a horizontal ray to infinity and counting edge crossings. An odd count means inside. An even count means outside. Vertices that lie on the ray are counted under a rule that treats an edge…
How Jarvis march wraps a convex hull
Short answer: Jarvis march, or gift wrapping, builds a planar convex hull by starting at the leftmost point and repeatedly choosing the next hull vertex as the point with the smallest polar angle from the current vertex. Each step scans every point, so the time is O(n·h), where h…
How GJK tests two convex shapes for overlap
Short answer: The Gilbert-Johnson-Keerthi algorithm decides whether two convex sets intersect by chasing a simplex inside their Minkowski difference. The difference contains the origin exactly when the shapes touch or overlap. Each iteration asks a support function for the farthest point in a chosen direction, adds that point to…
How Fortune’s algorithm sweeps a Voronoi diagram
Short answer: Fortune’s algorithm computes the Voronoi diagram of a planar point set by sweeping a horizontal line downward and maintaining a beach line of parabolic arcs. Each site above the sweep line owns the points closer to it than to the sweep line, and the boundary of those…
How Cohen-Sutherland clips a segment with outcodes
Short answer: The Cohen-Sutherland algorithm clips a line segment to an axis-aligned rectangle by assigning each endpoint a 4-bit outcode. The bits say above, below, left, and right. If both codes are zero, the segment is inside. If the bitwise AND of the codes is nonzero, both endpoints share…
How Chan’s algorithm hulls in n log h time
Short answer: Chan’s algorithm computes a planar convex hull in O(n log h) time, where h is the number of hull vertices. It guesses a parameter m, splits the points into groups of size m, and hulls each group with a standard O(m log m) hull. Gift wrapping then…
How Bresenham rasters a line with integer steps
Short answer: Bresenham’s line algorithm chooses the pixel sequence from (x0, y0) to (x1, y1) using only integer additions. It walks the major axis one pixel at a time and keeps an error term that decides when the minor axis steps. Starting from zero and adding twice the minor…
How Bentley-Ottmann sweeps segment intersections
Short answer: The Bentley-Ottmann algorithm reports every intersection of a set of line segments by sweeping a vertical line from left to right. A balanced tree holds the segments that cross the sweep line, ordered by y. A priority queue holds left endpoints, right endpoints, and future intersection points…
How Andrew’s algorithm builds a monotone chain
Short answer: Andrew’s monotone chain computes a planar convex hull by sorting points by increasing x, then building the lower hull and the upper hull as stacks that pop non-left turns. The sort is O(n log n) and each chain is linear, so the total matches the Graham scan…
