Shamos gave the following algorithm in his dissertation (pp. 77–82) for the rotating calipers method, which generated all antipodal pairs of vertices on a 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[1..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[1..n])
i = n
j = i + 1
while (Area(i, i + 1, j + 1) > Area(i, i + 1, j))
j = j + 1
j0 = j
while (i != j0)
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, 1))
yield i, j
if (Area(i, i + 1, j + 1) = Area(i, i + 1, j))
if ((i, j) != (j0, n))
yield i, j + 1
Pirzadeh describes various applications of rotating calipers method.
"Rotating Calipers" at Toussaint's home page http://www-cgrl.cs.mcgill.ca/~godfried/research/calipers.html
Shamos, Michael (1978). "Computational Geometry" (PDF). Yale University. pp. 76–81. /wiki/Michael_Shamos
Toussaint, Godfried T. (1983). "Solving geometric problems with the rotating calipers". In Protonotarios, E. N.; Stassinopoulos, G. I.; Civalleri, P. P. (eds.). Proceedings of MELECON '83, Mediterranean Electrotechnical Conference, Athens, Greece, 24–26 May 1983. IEEE. pp. A10.02/1–4. CiteSeerX 10.1.1.155.5671. /wiki/Godfried_Toussaint
Shamos, Michael (1978). "Computational Geometry" (PDF). Yale University. pp. 76–81. /wiki/Michael_Shamos
Shamos, Franco P. Preparata, Michael Ian (1985). Computational Geometry An Introduction. New York, NY: Springer New York. ISBN 978-1-4612-7010-2.{{cite book}}: CS1 maint: multiple names: authors list (link) 978-1-4612-7010-2
Pirzadeh, Hormoz (1999). Computational geometry with the rotating calipers (Master's thesis). McGill University. https://escholarship.mcgill.ca/concern/theses/fx719p46g
Binay K. Bhattacharya and Godfried T. Toussaint, "Fast algorithms for computing the diameter of a finite planar set," The Visual Computer, Vol. 3, No. 6, May 1988, pp.379–388.
Binay K. Bhattacharya and Godfried T. Toussaint, "A counter example to a diameter algorithm for convex polygons," IEEE Transactions on Pattern Analysis and Machine Intelligence, Vol. PAMI-4, No. 3, May 1982, pp. 306–309.
Michael E. Houle and Godfried T. Toussaint, "Computing the width of a set," IEEE Transactions on Pattern Analysis & Machine Intelligence, Vol. 10, no. 5, September 1988, pp. 761–765.
Godfried T. Toussaint and Jim A. McAlear, "A simple O(n log n) algorithm for finding the maximum distance between two finite planar sets," Pattern Recognition Letters, Vol. 1, 1982, pp. 21–24.
Binay K. Bhattacharya and Godfried T. Toussaint, "Efficient algorithms for computing the maximum distance between two finite planar sets," Journal of Algorithms, vol. 14, 1983, pp. 121–136.
Godfried T. Toussaint and Binay K. Bhattacharya, "Optimal algorithms for computing the minimum distance between two finite planar sets," Pattern Recognition Letters, vol. 2, December, 1983, pp. 79–82.
"Rotating Calipers". 2015-03-30. Archived from the original on 2015-03-30. Retrieved 2017-03-22.{{cite web}}: CS1 maint: bot: original URL status unknown (link) https://web.archive.org/web/20150330010154/http://cgm.cs.mcgill.ca/~orm/rotcal.html
MARTINEZ, HUGO M. (January 1, 1978). "Review of: "PATTERN SYNTHESIS", by U. Grenander, Springer-Verlag, New York, 1976. 509 pp". International Journal of General Systems. 4 (2): 126–127. doi:10.1080/03081077808960672. ISSN 0308-1079. /wiki/Doi_(identifier)
Barequet and Wolfers (1998). "Optimizing a Strip Separating Two Polygons". Graphical Models and Image Processing. 60 (3): 214–221. doi:10.1006/gmip.1998.0470. https://doi.org/10.1006%2Fgmip.1998.0470
Teichmann, Marek (1989). Wedge placement optimization problems (Master's thesis). McGill University. https://escholarship.mcgill.ca/concern/theses/r207tq60s
Godfried T. Toussaint, "A simple linear algorithm for intersecting convex polygons, The Visual Computer, Vol. 1, 1985, pp. 118–123.
Tomas Lozano-Perez, "Spatial planning: A configuration space approach," IEEE Transactions on Computers, Vol. 32, No. 2, 1983, pp. 108–120.
Binay K. Bhattacharya and Godfried T. Toussaint, "Computing shortest transversals," Computing, vol. 46, 1991, pp. 93–119.
Binay K. Bhattacharya, Jurek Czyzowicz, Peter Egyed, Ivan Stojmenovic, Godfried T. Toussaint, and Jorje Urrutia, "Computing shortest transversals of sets," International Journal of Computational Geometry and Applications, Vol. 2, No. 4, December 1992, pp. 417–436.
Jean-Marc Robert and Godfried T. Toussaint, "Linear approximation of simple objects," Computational Geometry: Theory and Applications, Vol. 4, 1994, pp. 27–52. /wiki/Computational_Geometry_(journal)
Rasson and Granville (1996). "Geometrical tools in classification". Computational Statistics & Data Analysis. 23 (1): 105–123. doi:10.1016/S0167-9473(96)00024-2. /wiki/Doi_(identifier)
Bose, P.; Hurtado-Diaz, F.; Omaña-Pulido, E.; Snoeyink, J.; Toussaint, G. T. (2002-08-01). "Some Aperture-Angle Optimization Problems". Algorithmica. 33 (4): 411–435. CiteSeerX 10.1.1.16.7118. doi:10.1007/s00453-001-0112-9. ISSN 0178-4617. S2CID 27455160. /wiki/CiteSeerX_(identifier)
"Incorrect Diameter Algorithms for Convex Polygons". http://cgm.cs.mcgill.ca/~athens/cs507/Projects/2000/MS/diameter/document.html