• Determines if a point lies within a triangle in 2D space. Inspired by: https://stackoverflow.com/a/9755252/5946596

    Parameters

    • p: VectorLike

      The point to check [x, y].

    • a: VectorLike

      Vertex A of the triangle [x, y].

    • b: VectorLike

      Vertex B of the triangle [x, y].

    • c: VectorLike

      Vertex C of the triangle [x, y].

    • tolerance: number = 0.0001

      Precision tolerance for handling points near edges (default: 0.0001).

    Returns boolean

    True if the point is strictly inside the triangle; otherwise, false.

Generated using TypeDoc