calculates if a given point (in this case the mouse pointer) is inside any active triangle's interior. this is done by finding the sum of the areas of △P1P2M, △P2P3M, and P3P1M, and finding the difference between △P1P2P3. if the point is inside the triangle, the sum of areas will equal the area of △P1P2P3 since each triangle of the sum will share 2 points, and no area will overlap, as if you were to split the triangle up into 3 separate triangles and add them back together. however, if the sum of areas is greater than the area of △P1P2P3 the point is outside the triangle.