methods for finding min distance to surface