Further simplify getNearestPoint() algorithm.