Point inside a triangle or NOT
Problem Given three corner points of a triangle, and one more point P. Write a function to check whether P lies within the triangle or not.
Example For example, consider the following program, the function should return true for P(10, 15) and false for P’(30, 15)
B(10,30) / \\ / \\ / \\ / P \\ P' / \\ A(0,0) ----------- C(20,0) Solution Method 1 - Area of triangles made by point and other 2 vertices of triangle
[Read More]