../point-in-triangle

Point in Triangle

This is a small demonstration of one method to decide whether or not a point lies within a triangle

Click & drag the vertices of the triangle to change the shape

Three subtriangles are created by connecting each vertex of the triangle to the location of the cursor. We know the cursor is inside when the sum of the areas of these subtriangles is equal to the area of the original triangle. I believe that this works for all convex polygons