All pastes #88876 Raw Edit

Stuff

public python v1 · immutable
#88876 ·published 2006-07-15 12:40 UTC
rendered paste body
def linear(control,ix,iy, tox,toy,speed):    if (tox - ix):        m = (toy - iy)/float((tox - ix))        b = iy - (m * ix)    else:        m = 0    x = ix    y = iy    if m:        if tox < ix:            while not x == tox:                if y != toy:                    x -= speed                y = (m * x) + b                control.setPosition(x,y)                sleep(0.08)        else:            while not x == tox:                if y != toy:                    x += speed                y = (m * x) + b                control.setPosition(x,y)                sleep(0.08)    else:        if y > toy:            while y > toy:                x = ix                y -= speed                control.setPosition(x,y)                sleep(0.08)        else:            while toy < y:                x = ix                y += speed                control.setPosition(x,y)                sleep(0.08)