Introduced halfspace check for the invariant set.