magnet.geometric_utils.closest_to_triangle#

magnet.geometric_utils.closest_to_triangle(triangle_v: ndarray, p: ndarray) ndarray#

Compute the point of a triangle closest to a given point.

Computes the the point of the triangle of vertices triangle_v that is closest to the point p.

Parameters:
  • triangle_v (np.ndarray of float) – Array of shape (3, dim) of the coordinates of the vertices of the triangle.

  • p (np.ndarray of float) – Coordinates of the point of interest.

Returns:

The coordinates of the point closest to p.

Return type:

np.ndarray of float