(self, o)
Return True if o is on this Line, or False otherwise.
Return True if o is on this Line, or False otherwise.
Return True if o is on this Line or False otherwise .
def contains(self, o):
        """Return True if o is on this Line, or False otherwise."""
        if isinstance(o, Point):
            o = o.func(*[simplify(i) for i in o.args])
            x, y = Dummy(), Dummy()
            eq = self.equation(x, y)
            if not eq.has(y):
                return (solve(eq, x)[0] - o.x).equals(0)
            if not eq.has(x):
                return (solve(eq, y)[0] - o.y).equals(0)
            return (solve(eq.subs(x, o.x), y)[0] - o.y).equals(0)
        elif not isinstance(o, LinearEntity):
            return False
        elif isinstance(o, Line):
            return self.__eq__(o)
        elif not self.is_similar(o):
            return False
        else:
            return o.p1 in self and o.p2 in self
def contains ( self , o ) : if isinstance ( o , Point ) : o = o . func ( * [ simplify ( i ) for i in o . args ] ) x , y = Dummy ( ) , Dummy ( ) eq = self . equation ( x , y ) if not eq . has ( y ) : return ( solve ( eq , x ) [ 0 ] - o . x ) . equals ( 0 ) if not eq . has ( x ) : return ( solve ( eq , y ) [ 0 ] - o . y ) . equals ( 0 ) return ( solve ( eq . subs ( x , o . x ) , y ) [ 0 ] - o . y ) . equals ( 0 ) elif not isinstance ( o , LinearEntity ) : return False elif isinstance ( o , Line ) : return self . __eq__ ( o ) elif not self . is_similar ( o ) : return False else : return o . p1 in self and o . p2 in self