def line(a,b,n):
    """Retun a list of n points on the segment between points a and b."""
    (x0,y0) = a
    (x1,y1) = b
    lst = []
    for i in range(n):
        t = i/(n-1.0)
        x = (1.0 - t) * x0 + t * x1
        y = (1.0 - t) * y0 + t * y1
        lst.append((x,y))
    return lst