return whether two boxes or points are colliding in 2d