NN Distances: Make Z-position optional
(effectively allowing for 2D and 3D positions)