GJK algorithm
A method that decides whether two convex bodies collide by hunting for the origin inside their Minkowski difference.
Named after Elmer Gilbert, Daniel Johnson and Sathiya Keerthi, who described it in 1988. The key insight is that two convex sets intersect exactly when their Minkowski difference contains the origin. GJK searches for the origin without ever building the full difference: it only asks for support points — the shape's farthest point in a given direction — and grows a tiny simplex (at most a tetrahedron) that either encloses the origin or proves it unreachable.
Because everything goes through support functions, the same code handles polyhedra, spheres, cylinders and capsules — anything convex. GJK yields the distance when the shapes are apart; for penetration depth once they already overlap it is paired with EPA. The algorithm is a cornerstone of physics engines such as Bullet and runs in the narrow phase.