+ def __contains__(self, point):
+ if not isinstance(point, Point):
+ raise TypeError('point must be a Point instance')
+ if self.symbols != point.symbols:
+ raise ValueError('arguments must belong to the same space')
+ for equality in self.equalities:
+ if equality.subs(point.coordinates()) != 0:
+ return False
+ for inequality in self.inequalities:
+ if inequality.subs(point.coordinates()) < 0:
+ return False
+ return True
+