closest_simplex#

iskra.geometry.distances.closest_simplex(x: Tensor, simplices: Tensor) tuple[Tensor, Tensor, Tensor][SOURCE]#

Finds the closest simplex to a set of points.

Thin dispatcher to one of iskra.closest_edge, iskra.closest_triangle. See documentation of these functions for more information. Bs3 is the shape that results from broadcasting Bs1 and Bs2.

Parameters:
  • x (Tensor[Float, [Bs1, Dim]]) – Set of points.

  • simplices (Tensor[Float, [Bs2, S, Dim]]) – Set of simplices.

Returns:
  • (Tensor[Float, [Bs3, Dim]]) – Closest projection of x onto the set of simplices.

  • ​​ (Tensor[Float, [Bs3]]) – Distance of x to the closest projection.

  • ​​​ (Tensor[Float, [Bs3]]) – Index of the simplex that was projected on.