Gilbert-Johnson-Keerthi distance algorithm