I have two rectangles characterized by 4 values each :
Left position X, top position Y, width W and height H:
X
Y
W
H
Should the two rectangles have the same dimensions you can do:
if (abs (x1 - x2) < w && abs (y1 - y2) < h) { // overlaps }