Your question is unclear as to dimension. If you mean higher dimensions, you are not thinking about the problem clearly.
Assuming a 2d plane (and you can take a higher dimensioned object and project into a plane if necessary):
The subquestion you need is how to find when a line intersects another line. You did not draw the only case. One vertex of your triangle could be inside the other.
If you just need to know true or false if two triangles intersect, then test whether any of the lines intersect, or test whether any corner of t2 is "inside" t1 where inside includes being on the line. Note that there can be roundoff problems on the line.
How do you detect where two line segments intersect?
if (t1.contains.t2) {
}
will be true if:
bool contains(double x, double y) {
return
(p1 - p2).toLeft(x,y) &&
(p2 - p3).toLeft(x,y) &&
(p3 - p1).toLeft(x,y);
}
bool contains(const Triangle& t2) {
return contains(t2.p1) || contains(t2.p2) || contains(t2.p3);
}
THe algorithm for whether the point is to the left of the line is here:
How to tell whether a point is to the right or left side of a line