'Return True if o is contained within the boundary lines of self.altitudes
Parameters
other : GeometryEntity
Returns
contained in : bool
The points (and sides, if applicable) are contained in self.
See Also
sympy.geometry.entity.GeometryEntity.encloses
Examples
>>> from sympy import Line, Segment, Point
>>> p = Point(0, 0)
>>> q = Point(1, 1)
>>> s = Segment(p, q*2)
>>> l = Line(p, q)
>>> p in q
False
>>> p in s
True
>>> q*3 in s
False
>>> s in l
True'

def __contains__(self, o):

    if isinstance(o, Polygon):
        return (self == o)
    elif isinstance(o, Segment):
        return any(((o in s) for s in self.sides))
    elif isinstance(o, Point):
        if (o in self.vertices):
            return True
        for side in self.sides:
            if (o in side):
                return True
    return False
