def lin(pos, goal, x, n_steps):
    """
        Returns the y value of a linear function based which goes from y=pos
        on x=0 to y=goal on x=n_steps.
    """
    return pos + (1/(n_steps-1) * (goal-pos))*x