I want to solve a question, but it's a little hard and I need some help. The question is:
we have 2 triangles, and we have the coordinates of the vertices like (x1, y1), (x2, y2), (x3, y3), (a1, b1), (a2, b2), (a3, b3). We want to measure the area that two triangles are on each other. It may be 0 or more.
For example, if we have for first triangle (0,0) (3,0) (0,3) and the second (0,0) (3,3) (3,0), the common area will be 2.25.
How should i write a program to solve this?