resqpy.olio.vector_utilities.point_in_triangle

resqpy.olio.vector_utilities.point_in_triangle(x, y, triangle)[source]

Calculates if a point in within a triangle in 2D.

Parameters:
  • x (float) – the point’s x-coordinate.

  • y (float) – the point’s y-coordinate.

  • triangle (np.ndarray) – array of the triangles’s vertices in 2D, of shape (3, 2)

Returns:

inside (bool) – True if point is within the polygon, False otherwise.