Do two triangles intersect? --------------------------- Given two triangles, do they intersect? That is, does there exist a point that is part of both triangles. Points on the border are considered part the triangle. A point is represented by its x- and y-coordinates and a triangle is represented by its three corners. Input ----- The input begins with a single positive integer on a line by itself indicating the number of cases following, each of them on a line as described below. Each case is described by twelve real numbers x0, y0, ..., x5, y5. (x0, y0), (x1, y1) and (x2, y2) represent the corners of the one triangle and (x3, y3), (x4, y4) and (x5, y5) represent the corners of the other triangle. Output ------ For each test case, the output is true if the triangles intersect and false otherwise. Sample input ------------ 3 0 0 0 1 1 1 0 0 0 1 1 0 0 0 0 1 1 1 0 0 1 0 1 1 0 0 0 1 1 1 0 0 0 1 1 1 Sample output ------------- true true true