
IronChef/Erik 
He's picking the nearest vertex given a barycentric coordinate. The method is actually quite clever.
Given a triangle A+u(BA)+v(CA), the values of u and v corresponding to A, B and C respectively are (0,0), (1,0) and (0,1). We can partition the triangle into three quadrilateral regions corresponding to each vertex, such that if u and v are in that region, then the point is closer to that vertex than to any other. The regions all share a common vertex in the barycenter (1/3,1/3), and adjacent regions share vertices along edge midpoints, which are (1/2,0), (0,1/2) and (1/2,1/2).
The regions corresponding to each vertex are defined by the following points:
A: (0,0) (1/2,0) (1/3,1/3), (0,1/2) B: (1,0) (1/2,1/2) (1/3,1/3), (1/2,0) C: (0,1) (0,1/2) (1/3,1/3), (1/2,1/2)
The naive implementation would pick the pair (u,v) and then perform the four checks necessary to place it in a given region. In contrast, shields' method does the following. First, you notice that the line u=v is the line through A and the midpoint of the edge BC. The line u=(1uv) ==> 2u=1v ==> u = 1/2  1/2v is the line through C and the midpoint of the edge BA. Finally, the line v=(1uv) ==> 2v=1u ==> v = 1/2  1/2v is the line through B and the midpoint of the edge AC. But those are the exactly the lines that bound the regions we just found earlier.
So the code does the following:
If (u,v) is on the left of the line through A and (B+C)/2, then
{
If (u,v) is on the right of the line through C and (A+B)/2, then we're
closest to B. Otherwise, the point is closest to A.
}
else
{
If (u,v) is on the right of the line through B and (A+C)/2, then we're
closest to C. Otherwise, the point is closest to A.
}

goltrpoat
EDIT: "Left" and "right" are used assuming clockwise winding of the triangle, and the direction of splitter lines is taken to be going from a vertex to the midpoint of the opposite edge.
