'A parameterized point on the polygon.
The parameter, varying from 0 to 1, assigns points to the position on
the perimeter that is that fraction of the total perimeter. So the
point evaluated at t=1/2 would return the point from the first vertex
that is 1/2 way around the polygon.
Parameters
parameter : str, optional
Default value is \'t\'.
Returns
arbitrary_point : Point
Raises
ValueError
When `parameter` already appears in the Polygon\'s definition.
See Also
sympy.geometry.point.Point
Examples
>>> from sympy import Polygon, S, Symbol
>>> t = Symbol(\'t\', real=True)
>>> tri = Polygon((0, 0), (1, 0), (1, 1))
>>> p = tri.arbitrary_point(\'t\')
>>> perimeter = tri.perimeter
>>> s1, s2 = [s.length for s in tri.sides[:2]]
>>> p.subs(t, (s1 + s2/2)/perimeter)
Point2D(1, 1/2)'

def arbitrary_point(self, parameter='t'):

    t = _symbol(parameter)
    if (t.name in (f.name for f in self.free_symbols)):
        raise ValueError(('Symbol    %s    already    appears    in    object    and    cannot    be    used    as    a    parameter.' % t.name))
    sides = []
    perimeter = self.perimeter
    perim_fraction_start = 0
    for s in self.sides:
        side_perim_fraction = (s.length / perimeter)
        perim_fraction_end = (perim_fraction_start + side_perim_fraction)
        pt = s.arbitrary_point(parameter).subs(t, ((t - perim_fraction_start) / side_perim_fraction))
        sides.append((pt, And((perim_fraction_start <= t), (t < perim_fraction_end))))
        perim_fraction_start = perim_fraction_end
    return Piecewise(*sides)
