Point.in_triangle

Point.in_triangle(triangle)[source]

Determine if the point lies inside the given triangle.

Parameters

triangle ([point, point, point] | Polygon) – The triangle.

Returns

bool – True, if the point lies in the triangle. False, otherwise.

Examples

>>> from compas.geometry import Polygon
>>> tri = Polygon([Point(0.0, 0.0, 0.0), Point(1.0, 0.0, 0.0), Point(0.5, 1.0, 0.0)])
>>> point = Point(0.5, 0.5, 0.0)
>>> point.in_triangle(tri)
True