hahah dang... I just came across a problem where I need to figure out if one rotated rectangle intersects or is a part of another rotated rectangle, and I hoped this was about that.
WAIT just thought of a solution
[edit]
for anyone who cares, you have two rectangles A and B (with vertices A1, A2 ... A4, B1 etc)
using the SameSide function described
here (http://www.blackpawn.com/texts/pointinpoly/default.html), we can make a function:
pointInConvexQuadrilateral(p, a,b,c,d)
if SameSide(p,a, b,c) and SameSide(p,b, c,d) and SameSide(p,c, d,a) and SameSide(p,d, a,b)
return true;
else
return false;
(since rectangles are convex quadrilaterals, the verbose function name might not be needed. it's just there for clarity)
Since a rectangle is a space bounded by linear functions, for a rectangle A to have space that also belongs to a rectangle B, a vertex of A is in B, and/or a vertex of B is in A. So...
(with the pointInConvexQuadrilateral function renamed to the more concise pointInQuad(p, a,b,c,d))
bool RectangleSpaceShared(Rectangle A, Rectangle B)
{
if(
pointInQuad(A1, B1,B2,B3,B4)||
pointInQuad(A2, B1,B2,B3,B4)||
pointInQuad(A3, B1,B2,B3,B4)||
pointInQuad(A4, B1,B2,B3,B4)||
pointInQuad(B1, A1,A2,A3,A4)||
pointInQuad(B2, A1,A2,A3,A4)||
pointInQuad(B3, A1,A2,A3,A4)||
pointInQuad(B4, A1,A2,A3,A4) )
return true;
else
return false;
}
not the most efficient way to do it, it's probably not the best algorithm, and the code itself could be sped up at the cost of readability, but it's good enough for my purposes. (my purposes are camera-culling which is done once per frame, on 30-40 rectangles, so that's not bad at all.)

Why does blue text appear every time you are near?