Here's 2 methods available;
if(rectangle.Intersects(otherRectangle))
{
//collision stuff
}
Catch: Only works with non-rotating rectangles.
if(Vector2.Distance(player.pos, enemy.pos) < 50)
{
//collision stuff
}
Catch: Only works with circles.
What I want is to calculate x and y in this image: 
Facts
The width and length of both rectangles is defined, along with their rotations. I can calculate D using the Pythagorean theorem. But the TRUE distance is D - (X + Y).
General approach
Evidently x and y can be calculated using the Cosine rule. But I only have the width or length and the angle between the two shapes.
Complication
Plus, this needs to work for any rotation. The rectangle on the left could be rotated in any direction, and x would be different depending on said rotation.
Question
How would I calculate x and y? I just want an effective collision detection method more complex than bounding boxes and Pythagoras' theorem.
Vector2methods, such asVector2.Dot()