(self)
return Point(x, y)
A random point on a LinearEntity.

        Returns
        =======

        point : Point

        See Also
        ========

        sympy.geometry.point.Point

        Examples
        ========

        >>> from sympy import Point, Line
        >>> p1, p2 = Point(0, 0), Point(5, 3)
        >>> l1 = Line(p1, p2)
        >>> p3 = l1.random_point()
        >>> # random point - don't know its coords in advance
        >>> p3 # doctest: +ELLIPSIS
        Point(...)
        >>> # point should belong to the line
        >>> p3 in l1
        True
A random point on a LinearEntity.
A random point on a LinearEntity .
def random_point(self):
        """A random point on a LinearEntity.

        Returns
        =======

        point : Point

        See Also
        ========

        sympy.geometry.point.Point

        Examples
        ========

        >>> from sympy import Point, Line
        >>> p1, p2 = Point(0, 0), Point(5, 3)
        >>> l1 = Line(p1, p2)
        >>> p3 = l1.random_point()
        >>> # random point - don't know its coords in advance
        >>> p3 # doctest: +ELLIPSIS
        Point(...)
        >>> # point should belong to the line
        >>> p3 in l1
        True

        """
        from random import randint

        # The lower and upper
        lower, upper = -2**32 - 1, 2**32

        if self.slope is S.Infinity:
            if isinstance(self, Ray):
                if self.ydirection is S.Infinity:
                    lower = self.p1.y
                else:
                    upper = self.p1.y
            elif isinstance(self, Segment):
                lower = self.p1.y
                upper = self.p2.y

            x = self.p1.x
            y = randint(lower, upper)
        else:
            if isinstance(self, Ray):
                if self.xdirection is S.Infinity:
                    lower = self.p1.x
                else:
                    upper = self.p1.x
            elif isinstance(self, Segment):
                lower = self.p1.x
                upper = self.p2.x

            a, b, c = self.coefficients
            x = randint(lower, upper)
            y = (-c - a*x) / b
        return Point(x, y)
def random_point ( self ) : from random import randint # The lower and upper lower , upper = - 2 ** 32 - 1 , 2 ** 32 if self . slope is S . Infinity : if isinstance ( self , Ray ) : if self . ydirection is S . Infinity : lower = self . p1 . y else : upper = self . p1 . y elif isinstance ( self , Segment ) : lower = self . p1 . y upper = self . p2 . y x = self . p1 . x y = randint ( lower , upper ) else : if isinstance ( self , Ray ) : if self . xdirection is S . Infinity : lower = self . p1 . x else : upper = self . p1 . x elif isinstance ( self , Segment ) : lower = self . p1 . x upper = self . p2 . x a , b , c = self . coefficients x = randint ( lower , upper ) y = ( - c - a * x ) / b return Point ( x , y )