def linear(m0,m1,u,domain=None):
    """For completeness: linear interpolation between m0 and m1 at parameter u in [0,1].
    
    Alternatively, if `domain` != None, then this will use domain=(a,b)
    """
    if domain is not None:
        return linear(m0,m1,(u-domain[0])/(domain[1]-domain[0]))
    return (1.0-u)*m0 + u*m1