Given two image, A and B.
The top-left corner of A: (x0, y0)
The bottom-right corner of A: (x1, y1)
The top-left corner of B: (x2, y2)
The bottom-right corner of B: (x3, y3)
I am coding a game using MIPS which involves a bomb bombing an object. To check its intersection, what I could thought of is just EIGHT independent cases, that is, a particular corner of an image is inside another image and vice versa. The Boolean expression is so long.
(x1 <= x3 && x3 <= x2 && y1 <= y3 && y3 <= y2) ||
(x1 <= x4 && x4 <= x2 && y1 <= y3 && y3 <= y2) ||
...... (six more)
So, I want to know the simplest Boolean expression (maybe in C program format) which return true iff the two images intersects with each other.
Thanks!