Rotating Calipers
   HOME

TheInfoList



OR:

In
computational geometry Computational geometry is a branch of computer science devoted to the study of algorithms which can be stated in terms of geometry. Some purely geometrical problems arise out of the study of computational geometric algorithms, and such problems ar ...
, the method of rotating calipers is an
algorithm design In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific problems or to perform a computation. Algorithms are used as specifications for performing c ...
technique that can be used to solve optimization problems including finding the width or
diameter In geometry, a diameter of a circle is any straight line segment that passes through the center of the circle and whose endpoints lie on the circle. It can also be defined as the longest chord of the circle. Both definitions are also valid for ...
of a set of points. The method is so named because the idea is analogous to rotating a spring-loaded vernier caliper around the outside of a
convex polygon In geometry, a convex polygon is a polygon that is the boundary of a convex set. This means that the line segment between two points of the polygon is contained in the union of the interior and the boundary of the polygon. In particular, it is a ...
. Every time one blade of the caliper lies flat against an edge of the polygon, it forms an antipodal pair with the point or edge touching the opposite blade. The complete "rotation" of the caliper around the polygon detects all antipodal pairs; the set of all pairs, viewed as a graph, forms a
thrackle A thrackle is an embedding of a graph in the plane, such that each edge is a Jordan arc and every pair of edges meet exactly once. Edges may either meet at a common endpoint, or, if they have no endpoints in common, at a point in their interiors. ...
. The method of rotating calipers can be interpreted as the projective dual of a
sweep line algorithm In computational geometry, a sweep line algorithm or plane sweep algorithm is an algorithmic paradigm that uses a conceptual ''sweep line'' or ''sweep surface'' to solve various problems in Euclidean space. It is one of the key techniques in compu ...
in which the sweep is across slopes of lines rather than across - or -coordinates of points.


History

The rotating calipers method was first used in the dissertation of Michael Shamos in 1978. Shamos uses this method to generate all antipodal pairs of points on a
convex polygon In geometry, a convex polygon is a polygon that is the boundary of a convex set. This means that the line segment between two points of the polygon is contained in the union of the interior and the boundary of the polygon. In particular, it is a ...
and to compute the diameter of a convex polygon in O(n) time.
Godfried Toussaint Godfried Theodore Patrick Toussaint (1944 – July 2019) was a Canadian computer scientist, a professor of computer science, and the head of the Computer Science Program at New York University Abu Dhabi (NYUAD) in Abu Dhabi, United Arab Emirates ...
coined the phrase "rotating calipers" and also demonstrated that the method was applicable in solving many other computational geometry problems.


Shamos's algorithm

Shamos gave following algorithm in his dissertation (pp 77–82) for the rotating calipers method that generated all antipodal pairs of vertices on convex polygon: /* p[] is in standard form, ie, counter clockwise order, distinct vertices, no collinear vertices. ANGLE(m, n) is a procedure that returns the clockwise angle swept out by a ray as it rotates from a position parallel to the directed segment Pm,Pm+1 to a position parallel to Pn, Pn+1 We assume all indices are reduced to mod N (so that N+1 = 1). */ GetAllAntiPodalPairs(p ..n // Find first anti-podal pair by locating vertex opposite P1 i = 1 j = 2 while angle(i, j) < pi j++ yield i, j /* Now proceed around the polygon taking account of possibly parallel edges. Line L passes through Pi, Pi+1 and M passes through Pj, Pj+1 */ // Loop on j until all of P has been scanned current = i while j != n if angle(current, i + 1) <= angle(current, j + 1) j++ current = j else i++ current = i yield i, j // Now take care of parallel edges if angle(current, i + 1) = angle(current, j + 1) yield i + 1, j yield i, j + 1 yield i + 1, j + 1 if current = i j++ else i++ Another version of this algorithm appeared in the text by Preparata and Shamos in 1985 that avoided calculation of angles: GetAllAntiPodalPairs(p ..n i0 = n i = 1 j = i + 1 while (Area(i, i + 1, j + 1) > Area(i, i + 1, j)) j = j + 1 j0 = j while (j != i0) i = i + 1 yield i, j while (Area(i, i + 1, j + 1) > Area(i, i + 1, j) j = j + 1 if ((i, j) != (j0, i0)) yield i, j else return if (Area(j, i + 1, j + 1) = Area(i, i + 1, j)) if ((i, j) != (j0, i0)) yield i, j + 1 else yield i + 1, j


Applications

Pirzadeh describes various applications of rotating calipers method.


Distances

* Diameter (maximum width) of a convex polygon * Width ( minimum width) of a convex polygon * Maximum distance between two convex polygons * Minimum distance between two convex polygons * Widest empty (or separating) strip between two convex polygons (a simplified low-dimensional variant of a problem arising in
support vector machine In machine learning, support vector machines (SVMs, also support vector networks) are supervised learning models with associated learning algorithms that analyze data for classification and regression analysis. Developed at AT&T Bell Laboratorie ...
based machine learning) * Grenander distance between two convex polygons * Optimal strip separation (used in medical imaging and solid modeling)


Bounding boxes

* Minimum area
oriented bounding box In geometry, the minimum or smallest bounding or enclosing box for a point set in dimensions is the box with the smallest measure (area, volume, or hypervolume in higher dimensions) within which all the points lie. When other kinds of measure ...
* Minimum perimeter
oriented bounding box In geometry, the minimum or smallest bounding or enclosing box for a point set in dimensions is the box with the smallest measure (area, volume, or hypervolume in higher dimensions) within which all the points lie. When other kinds of measure ...


Triangulations

* Onion triangulations * Spiral triangulations *
Quadrangulation In graph theory, a branch of mathematics, a squaregraph is a type of undirected graph that can be drawn in the plane in such a way that every bounded face is a quadrilateral and every vertex with three or fewer neighbors is incident to an unboun ...
* Nice triangulation * Art gallery problem * Wedge placement optimization problem


Multi-polygon operations

* Union of two convex polygons * Common tangents to two convex polygons * Intersection of two convex polygons *
Critical support line In geometry, a supporting line ''L'' of a curve ''C'' in the plane is a line that contains a point of ''C'', but does not separate any two points of ''C''."The geometry of geodesics", Herbert Busemannp. 158/ref> In other words, ''C'' lies completely ...
s of two convex polygons * Vector sums (or Minkowski sum) of two convex polygons * Convex hull of two convex polygons


Traversals

* Shortest transversals * Thinnest-strip transversals


Others

* Non parametric decision rules for machine learned classification * Aperture angle optimizations for visibility problems in computer vision * Finding longest cells in millions of biological cells{{Cite web, url = http://cgm.cs.mcgill.ca/~athens/cs507/Projects/2000/MS/diameter/document.html, title = Incorrect Diameter Algorithms for Convex Polygons * Comparing precision of two people at firing range * Classify sections of brain from scan images


See also

*
Convex polygon In geometry, a convex polygon is a polygon that is the boundary of a convex set. This means that the line segment between two points of the polygon is contained in the union of the interior and the boundary of the polygon. In particular, it is a ...
*
Convex hull In geometry, the convex hull or convex envelope or convex closure of a shape is the smallest convex set that contains it. The convex hull may be defined either as the intersection of all convex sets containing a given subset of a Euclidean space ...
*
Smallest enclosing box In computational geometry, the smallest enclosing box problem is that of finding the oriented minimum bounding box enclosing a set of points. It is a type of bounding volume. "Smallest" may refer to volume, area, perimeter, ''etc.'' of the box. It ...


References

Geometric algorithms Convex geometry