If defined and two points have the same distance, the one with the lowest-index will be returned first.