'Shift the object by adding to the x,y-coordinates the values x and y.
See Also
rotate, scale
Examples
>>> from sympy import RegularPolygon, Point, Polygon
>>> t = Polygon(*RegularPolygon(Point(0, 0), 1, 3).vertices)
>>> t
Triangle(Point2D(1, 0), Point2D(-1/2, sqrt(3)/2), Point2D(-1/2, -sqrt(3)/2))
>>> t.translate(2)
Triangle(Point2D(3, 0), Point2D(3/2, sqrt(3)/2), Point2D(3/2, -sqrt(3)/2))
>>> t.translate(2, 2)
Triangle(Point2D(3, 2), Point2D(3/2, sqrt(3)/2 + 2),
Point2D(3/2, -sqrt(3)/2 + 2))'

def translate(self, x=0, y=0):

    newargs = []
    for a in self.args:
        if isinstance(a, GeometryEntity):
            newargs.append(a.translate(x, y))
        else:
            newargs.append(a)
    return self.func(*newargs)
