title: Triangle - Square intersection test in 2d
body: <p>How can I test if a triangle and a square is intersecting each other?</p>
  
  <p>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?</p>
  
  <p>Or should I just break the square into triangles, and make triangle-triangle intersection check twice?</p>
  
  <p><strong>Edit:</strong> 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.</p>