Complete O(nLogn) closest points in 2d calculator