'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
Point2D(...)
>>> # point should belong to the line
>>> p3 in l1
True'

def random_point(self):

    from random import randint
    from sympy.functions import floor
    (lower, upper) = (((- (2 ** 32)) - 1), (2 ** 32))
    if isinstance(self, Ray):
        lower = 0
    if isinstance(self, Segment):
        lower = 0
        upper = floor(self.length)
    t = randint(lower, upper)
    return (((self.direction * t) / abs(self.direction)) + self.p1)
