closest point computation routine.