Distance computation between a point and a polygon or line (for short distances)