def interpolate(a, b, v, doRound=False):
    """Answers the interpolated value of factor v between a and b. If doRound
    is True (default is False), then round the result before answering it."""
    i = a + (b-a) * v
    if doRound:
        i = int(round(i))
    return i