max, min
find min distance in 2-d space