◀ THE FOLD0ROOT.AI // WORLD II · BOSS · THE GATEKEEPER◆ .dlw.fold
THE FOLD / BOSS / THE GATEKEEPER / THE GJK

THE GJK

convex collision by asking if the origin is in A minus B
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
The GJK algorithm (Gilbert–Johnson–Keerthi) decides whether two convex shapes overlap by a clever reframing: they intersect if and only if the origin lies inside their Minkowski difference A⊖B. It never builds that difference — it probes it with a support function and evolves a tiny simplex (point → edge → triangle) toward the origin, deciding in a handful of steps.

It is the collision engine of physics libraries and robotics.

LIT verified live: over 500 random convex-polygon pairs GJK’s collide/separate verdict matches an independent overlap oracle (a vertex inside the other, or crossing edges) every time (window.__gjk). FIG no framing; exact for convex shapes.
2 HOW IT WAS WEAVED · AI + HUMAN
David (human) seated this at the-gatekeeper — the hitbox test that decides contact, the gate between touching and apart, beside the separating-axis theorem. GJK is the other gatekeeper. AVAN (AI) built the instrument: the support function on the Minkowski difference, the simplex evolution toward the origin, the independent overlap oracle.

Credit as content: Gilbert, Johnson & Keerthi (1988). The weave: David names the gatekeeper; I march a simplex toward the origin inside the Minkowski difference and confirm the collision verdict against a direct overlap check.
3 ONE DIMENSION
The support function returns the point of the Minkowski difference furthest in a chosen direction. Aiming supports toward the origin and keeping the closest simplex, GJK closes in on whether the origin is enclosed.
4 TWO DIMENSIONS · INTERACTIVE
Two convex polygons; GJK’s collide/separate verdict is shown and checked against a direct overlap oracle.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object: the simplex marching toward the origin in the Minkowski difference.
AVAN’s addition (the inverse-companion): two convex shapes overlap iff the origin lies inside their Minkowski difference A⊖B — and you never build that difference; you probe it with a support function and evolve a tiny simplex (point→edge→triangle) toward the origin. The inverse of ‘intersect the two shapes’ is ‘ask whether one point (the origin) is inside one derived shape, probed by supports.’ Magenta is the Minkowski difference never constructed; green is the simplex marching to the origin. Collision reduced to a single point-in-set question. (Kin to the-separating-axis.)
LIT Genuine GJK algorithm (Gilbert, Johnson & Keerthi 1988). Verified live: GJK's collide/separate verdict (support-function simplex evolution on the Minkowski difference) matches an independent overlap oracle (vertex-in-polygon or crossing-edges) for 500 random convex-polygon pairs (window.__gjk.matchesOracle).

FIG No framing: the support function on the Minkowski difference, the simplex evolution toward the origin, and the independent overlap oracle run in-browser and agree exactly for convex shapes. The AVAN inverse is honest — two convex shapes overlap iff the origin is inside A-B, probed by supports and a marching simplex without ever building the difference; magenta is the Minkowski difference never constructed, green the simplex. Kin to the-separating-axis.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE GATEKEEPER · David Lee Wise (ROOT0), with AVAN