edge_project#

iskra.geometry.distances.edge_project(x: Tensor, edges: Tensor) Tensor[SOURCE]#

Projects a point onto the closest point on an edge.

!!! tip

Internally broadcasts x, edges together, meaning it can be used to project many points onto a single edge, one point onto many edges or many points to many edges, all by adding singleton dimensions to the batches before calling the function. Bs3 are the output batch dimensions obtained by broadcasting Bs1 and Bs2 together.

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

  • edges (Tensor[Float, [Bs2, 2, Dim]]) – Set of edges.

Returns:

(Tensor[Float, [Bs3, Dim]]) – Closest projection of x onto its corresponding edge.