I’m just wondering if there is any simple/efficient way to check if square falls inside a triangle. or at least one corner falls inside or some overlaps. e.g. considering the figure below, I should be able to tell that the 3 squares fall inside. i.e. square 1 is obviously inside, one corner of square 2 is inside, and 3 overlaps.

I’m just wondering if there is any simple/efficient way to check if square falls
Share
I’m checking out this nice tutorial. It explains how to test if a point is inside a triangle using various techniques. It seems it would help when a square corner falls inside.
And I liked the Barycentric technique, here I re-implemented it for matlab:
Then I would test each vertex of the square, and if it happens one of them falls inside I would return. Quite lot of computation but it worths a try.
For an overlap, I would test for intersections, as discussed in this thread, for every combination of lines from both a triangle and a square.