Sort points by distance