'Set up a user defined coordinate-system.
Arguments:
llx -- a number, x-coordinate of lower left corner of canvas
lly -- a number, y-coordinate of lower left corner of canvas
urx -- a number, x-coordinate of upper right corner of canvas
ury -- a number, y-coordinate of upper right corner of canvas
Set up user coodinat-system and switch to mode \'world\' if necessary.
This performs a screen.reset. If mode \'world\' is already active,
all drawings are redrawn according to the new coordinates.
But ATTENTION: in user-defined coordinatesystems angles may appear
distorted. (see Screen.mode())
Example (for a TurtleScreen instance named screen):
>>> screen.setworldcoordinates(-10,-0.5,50,1.5)
>>> for _ in range(36):
...     left(10)
...     forward(0.5)'

def setworldcoordinates(self, llx, lly, urx, ury):

    if (self.mode() != 'world'):
        self.mode('world')
    xspan = float((urx - llx))
    yspan = float((ury - lly))
    (wx, wy) = self._window_size()
    self.screensize((wx - 20), (wy - 20))
    (oldxscale, oldyscale) = (self.xscale, self.yscale)
    self.xscale = (self.canvwidth / xspan)
    self.yscale = (self.canvheight / yspan)
    srx1 = (llx * self.xscale)
    sry1 = ((- ury) * self.yscale)
    srx2 = (self.canvwidth + srx1)
    sry2 = (self.canvheight + sry1)
    self._setscrollregion(srx1, sry1, srx2, sry2)
    self._rescale((self.xscale / oldxscale), (self.yscale / oldyscale))
    self.update()
