function easeLinear(min, max, time, totaltime){
    var t = (totaltime - time) / totaltime;
    var a = max - min;
    return min + t * a;
}

function easeOut(min, max, time, totaltime){
    var t = (totaltime - time) / totaltime;
    var a = max - min;
    return min + (t * 2 - t ** 2) * a;
}

function easeIn(min, max, time, totaltime){
    var t = (totaltime - time) / totaltime;
    var a = max - min;
    return min + (t ** 2) * a;
}

function bounceIn(min, max, time, totaltime){
    var t = (totaltime - time) / totaltime;
    var a = max - min;
    var amp = 2;
    return max - (t ** 3 + t * amp * Math.sin(t * Math.PI)) * a;
}

function bounceOut(min, max, time, totaltime){
    var t = (totaltime - time) / totaltime;
    var a = max - min;
    var amp = 2;
    return min + (t ** 3 + t * amp * Math.sin(t * Math.PI)) * a;
}

function easeInBack(min, max, time, totaltime){
    var t = (totaltime - time) / totaltime;
    var a = max - min;
    var s = 1.70158;
    return min + (t * t * ((s + 1) * t - s)) * a;
}

function easeOutBack(min, max, time, totaltime){
    var t = (totaltime - time) / totaltime - 1;
    var a = max - min;
    var s = 1.70158;
    return min + (t * t * ((s + 1) * t * s) + 1) * a;
}

function easeInOutBack(min, max, time, totaltime){
    var t = (totaltime - time) / totaltime;
    var a = max - min;
    var s = 1.70158;
    s *= 1.525;
    if(t < totaltime / 2){
        return a * (t * t * ( (s + 1) * t - s)) + min;
    }else{
        t -= 2;
        return a / 2 * ( t * t * ((s + 1) * t + s) + 2) + min;
    }
}

function easeInCubic(min, max, time, totaltime){
    var t = (totaltime - time) / totaltime;
    var a = max - min;
    return min + (t * t * t) * a;
}

function easeOutCubic(min, max, time, totaltime){
    var t = (totaltime - time) / totaltime - 1;
    var a = max - min;
    return min + (t * t * t + 1) * a;
}