mrdja.ransacutils.get_plane_distances_to_points

mrdja.ransacutils.get_plane_distances_to_points(plane: ndarray, points: ndarray) ndarray[source]

Computes the distances from a plane to a collection of points.

Parameters:
  • plane (np.ndarray) – Plane parameters.

  • points (np.ndarray) – Collection of points.

Returns:

Distances from the plane to the points.

Return type:

np.ndarray

Example:

>>> import mrdja.ransac as ran
>>> import numpy as np
>>> points = np.array([[0, 0, 0], [1, 0, 0], [0, 1, 0]], dtype="float32")
>>> plane = np.array([0, 0, 1, 0], dtype="float32")
>>> ran.get_plane_distances_to_points(plane, points)
array([ 0.,  0.,  0.], dtype=float32)