This paper presents an implementation of the Gilbert-Johnson-Keerthi algorithm for computing the distance between convex objects, that has improved performance, robustness, and versatility over earlier implementations. The algorithm presented here is especially fit for use in collision detection of objects modeled using various types of geometric primitives, such as boxes, cones, and spheres, and their images under affine transformation, for instance, as described in VRML.
Bergen, van den, G. J. A. (1999). A fast and robust GJK implementation for collision detection of convex objects. Journal of Graphics Tools, 4(2), 7-25. https://doi.org/10.1080/10867651.1999.10487502, https://doi.org/10.1016/0263-7855(86)80087-X