You can try simple rectangle intersection test, or a reduced rectangle intersection test. Google is your best friend.