code: def distances_indices_sorted(self, points, sign=False):
          
          distances = [np.dot(self.normal_vector, pp) + self.d for pp in points]
          indices = sorted(range(len(distances)), key=lambda k: np.abs(distances[k]))
          if sign:
              indices = [(ii, int(np.sign(distances[ii]))) for ii in indices]
          return distances, indices
docs: Computes the distances from the plane to each of the points. Positive distances are on the side of the
          normal of the plane while negative distances are on the other side. Indices sorting the points from closest
          to furthest is also computed.
          :param points: Points for which distances are computed
          :param sign: Whether to add sign information in the indices sorting the points distances
          :return: Distances from the plane to the points (positive values on the side of the normal to the plane,
                   negative values on the other side), as well as indices of the points from closest to furthest. For
                   the latter, when the sign parameter is True, items of the sorting list are given as tuples of
                   (index, sign).