How can I test if a triangle and a square is intersecting each other?

Is there any way of optimizing this, when we know it's a square instead of rectangle? Also, the square is axis aligned, so that should give some more boost to performance?

Or should I just break the square into triangles, and make triangle-triangle intersection check twice?

Edit: To clarify: I'm trying to check if those two shapes overlap each other in any way. So the triangle can be inside square, and square can be inside triangle, and it should return true for that too.

Edit
Report