This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
If X1+H1 < X2 or X2+H2 < X1 or Y1+W1 < Y2 or Y2+W2 < Y1, they don't overlap (assuming heights and widths are positive). If none of these holds, they overlap. I don't think you can simplify it any further than that.
I replaced l and h with a and b respectively, because (1) l is a horrible name for a Java variable, and (2) to me names like l, h, w refer to the total height, length, or width. Since we're using a half-width and half height, I thought it better to remove a possible source of confusion. Anyway:
It might be possible to optimize this a bit more (deferring calculations of y and yMin, until they're really needed) but I think that would lose some clarity. [ December 31, 2004: Message edited by: Jim Yingst ]