def linear_equation(val1, val2, time1, time2, current_time):
    """Linear equation to get interpolated value.

    :param float val1: first keyframe value
    :param float val2: second keyframe value
    :param float time1: first keyframe local time
    :param float time2: second keyframe local time
    :param float current_time: current animation local time
    """
    return val1 + (val2 - val1) / (time2 - time1) * (current_time - time1)
