def _boxes_overlap(A, B):
    """determines area of overlap between boxes a and b
    
    Each box should be entered as [(LLx, LLy), (URx, URy)],
    where LL = lower left corner, and UR = upper right corner.
    """
    LLA, URA = A
    LLB, URB = B
    if LLA[0] > URB[0] or LLB[0] > URA[0] or \
        LLA[1] > URB[1] or LLB[1] > URA[1]:
            return 0.
    else:
        return ( max(LLA[0], LLB[0]) - min(URA[0], URB[0]) ) * \
                ( max(LLA[1], LLB[1]) - min(URA[1], URB[1]) )