Gilbert–Johnson–Keerthi distance algorithm: Difference between revisions

Content deleted Content added
Timrb (talk | contribs)
Include basic overview and pseudocode
Timrb (talk | contribs)
m Overview: wording
Line 12:
 
* <math>Support(shape, \vec{d})</math>, which returns the point on <math>shape</math> which has the highest dot product with <math>\vec{d}</math>.
* <math>NearestSimplex(s)</math>, which takes a simplex <math>s</math> and returns the simplex on <math>s</math> closest to the origin, and a direction toward the origin normal to the new simplex in the direction of the origin. If <math>s</math> itself contains the origin, <math>NearestSimplex</math> accepts <math>s</math> and the two shapes are determined to intersect.
 
The simplecies handled by <math>NearestSimplex</math> may each be any simplex sub-space of {{math|'''R'''<sup>''n''</sup>}}. For example in 3D, they may be a point, a line segment, a triangle, or a tetrahedron; each defined by 1, 2, 3, or 4 points respectively.