Linear combinations of vectors using a triangle

Lin Loi
A point is outside a triangle if one of the lambda values is smaller than 0
Points A,B,C are the vertices of the triangle. Point D is the point to check if it is inside the triangle ABC. Form vectors AB and AC and we are solving for the system of equations with 2 unknowns and 2 equations, which means that there have to be exactly one solution to the unknowns. The equation: lamda1*AB + lambda2*AC = AD when separation the above equation, we get one equation expressed with all the x-coordinates of all points and another equation expressed with all the y-coordinates of all points. Note that the lambda values are not barycentric coordinates but a linear combination of the edge-vectors