Test whether a point is inside a triangle, using barycentric coordinates and this algorithm from BlackPawn.
var inside =var triangle = 25 10 100 250 40 40console
You may also be interested in:
Returns true if the point
[x, y] is inside the triangle
[ [x1,y1], [x2,y2], [x3,y3] ], false otherwise.
MIT, see LICENSE.md for details.