(self, other)
return False
Is the other GeometryEntity contained within this Segment?

        Examples
        ========

        >>> from sympy import Point, Segment
        >>> p1, p2 = Point(0, 1), Point(3, 4)
        >>> s = Segment(p1, p2)
        >>> s2 = Segment(p2, p1)
        >>> s.contains(s2)
        True
Is the other GeometryEntity contained within this Segment?
Is the other GeometryEntity contained within this Segment?
def contains(self, other):
        """
        Is the other GeometryEntity contained within this Segment?

        Examples
        ========

        >>> from sympy import Point, Segment
        >>> p1, p2 = Point(0, 1), Point(3, 4)
        >>> s = Segment(p1, p2)
        >>> s2 = Segment(p2, p1)
        >>> s.contains(s2)
        True
        """
        if isinstance(other, Segment):
            return other.p1 in self and other.p2 in self
        elif isinstance(other, Point):
            if Point.is_collinear(self.p1, self.p2, other):
                t = Dummy('t')
                x, y = self.arbitrary_point(t).args
                if self.p1.x != self.p2.x:
                    ti = solve(x - other.x, t)[0]
                else:
                    ti = solve(y - other.y, t)[0]
                if ti.is_number:
                    return 0 <= ti <= 1
                return None

        # No other known entity can be contained in a Ray
        return False
def contains ( self , other ) : if isinstance ( other , Segment ) : return other . p1 in self and other . p2 in self elif isinstance ( other , Point ) : if Point . is_collinear ( self . p1 , self . p2 , other ) : t = Dummy ( 't' ) x , y = self . arbitrary_point ( t ) . args if self . p1 . x != self . p2 . x : ti = solve ( x - other . x , t ) [ 0 ] else : ti = solve ( y - other . y , t ) [ 0 ] if ti . is_number : return 0 <= ti <= 1 return None # No other known entity can be contained in a Ray return False