Closest point algorithm can be easily extended to support 2d points