export class Ease24 { static memberof static _Linear ( t , b , c , d ) { return c * t / d + b ; } static memberof static _1_SineIn ( t , b , c , d ) { return - c * Math . cos ( t / d * ( Math . PI / 2 ) ) + c + b ; } static memberof static _1_SineOut ( t , b , c , d ) { return c * Math . sin ( t / d * ( Math . PI / 2 ) ) + b ; } static memberof static _1_SineInOut ( t , b , c , d ) { return - c / 2 * ( Math . cos ( Math . PI * t / d ) - 1 ) + b ; } static memberof static _1_SineOutIn ( t , b , c , d ) { if ( t < d / 2 ) return ( c / 2 ) * Math . sin ( ( t * 2 ) / d * ( Math . PI / 2 ) ) + b ; return - ( c / 2 ) * Math . cos ( ( t * 2 - d ) / d * ( Math . PI / 2 ) ) + ( c / 2 ) + ( b + c / 2 ) ; } static memberof static _2_QuadIn ( t , b , c , d ) { return c * ( t /= d ) * t + b ; } static memberof static _2_QuadOut ( t , b , c , d ) { return - c * ( t /= d ) * ( t - 2 ) + b ; } static memberof static _2_QuadInOut ( t , b , c , d ) { if ( ( t /= d / 2 ) < 1 ) return c / 2 * t * t + b ; return - c / 2 * ( ( -- t ) * ( t - 2 ) - 1 ) + b ; } static memberof static _2_QuadOutIn ( t , b , c , d ) { if ( t < d / 2 ) return - ( c / 2 ) * ( t = ( t * 2 / d ) ) * ( t - 2 ) + b ; return ( c / 2 ) * ( t = ( t * 2 - d ) / d ) * t + ( b + c / 2 ) ; } static memberof static _3_CubicIn ( t , b , c , d ) { return c * ( t /= d ) * t * t + b ; } static memberof static _3_CubicOut ( t , b , c , d ) { return c * ( ( t = t / d - 1 ) * t * t + 1 ) + b ; } static memberof static _3_CubicInOut ( t , b , c , d ) { return ( ( t /= d / 2 ) < 1 ) ? c / 2 * t * t * t + b : c / 2 * ( ( t -= 2 ) * t * t + 2 ) + b ; } static memberof static _3_CubicOutIn ( t , b , c , d ) { return ( t < d / 2 ) ? c / 2 * ( ( t = t * 2 / d - 1 ) * t * t + 1 ) + b : c / 2 * ( t = ( t * 2 - d ) / d ) * t * t + b + c / 2 ; } static memberof static _4_QuartIn ( t , b , c , d ) { return c * ( t /= d ) * t * t * t + b ; } static memberof static _4_QuartOut ( t , b , c , d ) { return - c * ( ( t = t / d - 1 ) * t * t * t - 1 ) + b ; } static memberof static _4_QuartInOut ( t , b , c , d ) { if ( ( t /= d / 2 ) < 1 ) return c / 2 * t * t * t * t + b ; return - c / 2 * ( ( t -= 2 ) * t * t * t - 2 ) + b ; } static memberof static _4_QuartOutIn ( t , b , c , d ) { if ( t < d / 2 ) return - ( c / 2 ) * ( ( t = ( t * 2 ) / d - 1 ) * t * t * t - 1 ) + b ; return ( c / 2 ) * ( t = ( t * 2 - d ) / d ) * t * t * t + ( b + c / 2 ) ; } static memberof static _5_QuintIn ( t , b , c , d ) { return c * ( t /= d ) * t * t * t * t + b ; } static memberof static _5_QuintOut ( t , b , c , d ) { return c * ( ( t = t / d - 1 ) * t * t * t * t + 1 ) + b ; } static memberof static _5_QuintInOut ( t , b , c , d ) { if ( ( t /= d / 2 ) < 1 ) return c / 2 * t * t * t * t * t + b ; return c / 2 * ( ( t -= 2 ) * t * t * t * t + 2 ) + b ; } static memberof static _5_QuintOutIn ( t , b , c , d ) { if ( t < d / 2 ) return ( c / 2 ) * ( ( t = ( t * 2 ) / d - 1 ) * t * t * t * t + 1 ) + b ; return ( c / 2 ) * ( t = ( t * 2 - d ) / d ) * t * t * t * t + ( b + c / 2 ) ; } static memberof static _6_ExpoIn ( t , b , c , d ) { return t == 0 ? b : c * Math . pow ( 2 , 10 * ( t / d - 1 ) ) + b ; } static memberof static _6_ExpoOut ( t , b , c , d ) { return t == d ? b + c : c * ( 1 - Math . pow ( 2 , - 10 * t / d ) ) + b ; } static memberof static _6_ExpoInOut ( t , b , c , d ) { if ( t == 0 ) return b ; if ( t == d ) return b + c ; if ( ( t /= d / 2.0 ) < 1.0 ) return c / 2 * Math . pow ( 2 , 10 * ( t - 1 ) ) + b ; return c / 2 * ( 2 - Math . pow ( 2 , - 10 * -- t ) ) + b ; } static memberof static _6_ExpoOutIn ( t , b , c , d ) { if ( t < d / 2.0 ) return t * 2.0 == d ? b + c / 2.0 : c / 2.0 * ( 1 - Math . pow ( 2 , - 10 * t * 2.0 / d ) ) + b ; return ( ( t * 2.0 - d ) == 0 ) ? b + c / 2.0 : c / 2.0 * Math . pow ( 2 , 10 * ( ( t * 2 - d ) / d - 1 ) ) + b + c / 2.0 ; } static memberof static _7_CircIn ( t , b , c , d ) { return - c * ( Math . sqrt ( 1 - ( t /= d ) * t ) - 1 ) + b ; } static memberof static _7_CircOut ( t , b , c , d ) { return c * Math . sqrt ( 1 - ( t = t / d - 1 ) * t ) + b ; } static memberof static _7_CircInOut ( t , b , c , d ) { if ( ( t /= d / 2 ) < 1 ) return - c / 2 * ( Math . sqrt ( 1 - t * t ) - 1 ) + b ; return c / 2 * ( Math . sqrt ( 1 - ( t -= 2 ) * t ) + 1 ) + b ; } static memberof static _7_CircOutIn ( t , b , c , d ) { if ( t < d / 2 ) return ( c / 2 ) * Math . sqrt ( 1 - ( t = ( t * 2 ) / d - 1 ) * t ) + b ; return - ( c / 2 ) * ( Math . sqrt ( 1 - ( t = ( t * 2 - d ) / d ) * t ) - 1 ) + ( b + c / 2 ) ; } static param { number } overshoot memberof static _BackInWith ( overshoot = 1.70158 ) { return function ( t , b , c , d ) : number { return c * ( t /= d ) * t * ( ( overshoot + 1 ) * t - overshoot ) + b ; } ; } static param { number } overshoot memberof static _BackOutWith ( overshoot = 1.70158 ) { return function ( t , b , c , d ) : number { return c * ( ( t = t / d - 1 ) * t * ( ( overshoot + 1 ) * t + overshoot ) + 1 ) + b ; } ; } static param { number } overshoot memberof static _BackInOutWith ( overshoot = 1.70158 ) { return function ( t , b , c , d ) : number { if ( ( t /= d / 2 ) < 1 ) return c / 2 * ( t * t * ( ( ( overshoot * 1.525 ) + 1 ) * t - overshoot * 1.525 ) ) + b ; return c / 2 * ( ( t -= 2 ) * t * ( ( ( overshoot * 1.525 ) + 1 ) * t + overshoot * 1.525 ) + 2 ) + b ; } ; } static param { number } overshoot memberof static _BackOutInWith ( overshoot = 1.70158 ) { return function ( t , b , c , d ) : number { if ( t < d / 2 ) return ( c / 2 ) * ( ( t = ( t * 2 ) / d - 1 ) * t * ( ( overshoot + 1 ) * t + overshoot ) + 1 ) + b ; return ( c / 2 ) * ( t = ( t * 2 - d ) / d ) * t * ( ( overshoot + 1 ) * t - overshoot ) + ( b + c / 2 ) ; } ; } static memberof static _BackIn : Function = Ease24 . _BackInWith ( ) ; static memberof static _BackOut : Function = Ease24 . _BackOutWith ( ) ; static memberof static _BackInOut : Function = Ease24 . _BackInOutWith ( ) ; static memberof static _BackOutIn : Function = Ease24 . _BackOutInWith ( ) ; static memberof static _BounceIn ( t , b , c , d ) { if ( ( t = ( d - t ) / d ) < ( 1 / 2.75 ) ) return c - ( c * ( 7.5625 * t * t ) ) + b ; if ( t < ( 2 / 2.75 ) ) return c - ( c * ( 7.5625 * ( t -= ( 1.5 / 2.75 ) ) * t + 0.75 ) ) + b ; if ( t < ( 2.5 / 2.75 ) ) return c - ( c * ( 7.5625 * ( t -= ( 2.25 / 2.75 ) ) * t + 0.9375 ) ) + b ; return c - ( c * ( 7.5625 * ( t -= ( 2.625 / 2.75 ) ) * t + 0.984375 ) ) + b ; } static memberof static _BounceOut ( t , b , c , d ) { if ( ( t /= d ) < ( 1 / 2.75 ) ) return c * ( 7.5625 * t * t ) + b ; if ( t < ( 2 / 2.75 ) ) return c * ( 7.5625 * ( t -= ( 1.5 / 2.75 ) ) * t + 0.75 ) + b ; if ( t < ( 2.5 / 2.75 ) ) return c * ( 7.5625 * ( t -= ( 2.25 / 2.75 ) ) * t + 0.9375 ) + b ; return c * ( 7.5625 * ( t -= ( 2.625 / 2.75 ) ) * t + 0.984375 ) + b ; } static memberof static _BounceInOut ( t , b , c , d ) { if ( t < d / 2 ) { if ( ( t = ( d - t * 2 ) / d ) < ( 1 / 2.75 ) ) return ( c - ( c * ( 7.5625 * t * t ) ) ) * 0.5 + b ; if ( t < ( 2 / 2.75 ) ) return ( c - ( c * ( 7.5625 * ( t -= ( 1.5 / 2.75 ) ) * t + 0.75 ) ) ) * 0.5 + b ; if ( t < ( 2.5 / 2.75 ) ) return ( c - ( c * ( 7.5625 * ( t -= ( 2.25 / 2.75 ) ) * t + 0.9375 ) ) ) * 0.5 + b ; return ( c - ( c * ( 7.5625 * ( t -= ( 2.625 / 2.75 ) ) * t + 0.984375 ) ) ) * 0.5 + b ; } else { if ( ( t = ( t * 2 - d ) / d ) < ( 1 / 2.75 ) ) return ( c * ( 7.5625 * t * t ) ) * 0.5 + c * 0.5 + b ; if ( t < ( 2 / 2.75 ) ) return ( c * ( 7.5625 * ( t -= ( 1.5 / 2.75 ) ) * t + 0.75 ) ) * 0.5 + c * 0.5 + b ; if ( t < ( 2.5 / 2.75 ) ) return ( c * ( 7.5625 * ( t -= ( 2.25 / 2.75 ) ) * t + 0.9375 ) ) * 0.5 + c * 0.5 + b ; return ( c * ( 7.5625 * ( t -= ( 2.625 / 2.75 ) ) * t + 0.984375 ) ) * 0.5 + c * 0.5 + b ; } } static memberof static _BounceOutIn ( t , b , c , d ) { if ( t < d / 2 ) { if ( ( t = ( t * 2 ) / d ) < ( 1 / 2.75 ) ) return ( c / 2 ) * ( 7.5625 * t * t ) + b ; if ( t < ( 2 / 2.75 ) ) return ( c / 2 ) * ( 7.5625 * ( t -= ( 1.5 / 2.75 ) ) * t + 0.75 ) + b ; if ( t < ( 2.5 / 2.75 ) ) return ( c / 2 ) * ( 7.5625 * ( t -= ( 2.25 / 2.75 ) ) * t + 0.9375 ) + b ; return ( c / 2 ) * ( 7.5625 * ( t -= ( 2.625 / 2.75 ) ) * t + 0.984375 ) + b ; } else { if ( ( t = ( d - ( t * 2 - d ) ) / d ) < ( 1 / 2.75 ) ) return ( c / 2 ) - ( ( c / 2 ) * ( 7.5625 * t * t ) ) + ( b + c / 2 ) ; if ( t < ( 2 / 2.75 ) ) return ( c / 2 ) - ( ( c / 2 ) * ( 7.5625 * ( t -= ( 1.5 / 2.75 ) ) * t + 0.75 ) ) + ( b + c / 2 ) ; if ( t < ( 2.5 / 2.75 ) ) return ( c / 2 ) - ( ( c / 2 ) * ( 7.5625 * ( t -= ( 2.25 / 2.75 ) ) * t + 0.9375 ) ) + ( b + c / 2 ) ; return ( c / 2 ) - ( ( c / 2 ) * ( 7.5625 * ( t -= ( 2.625 / 2.75 ) ) * t + 0.984375 ) ) + ( b + c / 2 ) ; } } static param { number } amplitude param { number } period memberof static _ElasticInWith ( amplitude = 0 , period = 0 ) { return function ( t , b , c , d ) : number { t /= 1000 ; d /= 1000 ; if ( t == 0 ) return b ; if ( ( t /= d ) == 1 ) return b + c ; if ( ! period ) period = d * 0.3 ; var s ; if ( ! amplitude || amplitude < Math . abs ( c ) ) { amplitude = c ; s = period / 4 ; } else s = period / ( 2 * Math . PI ) * Math . asin ( c / amplitude ) ; return - ( amplitude * Math . pow ( 2 , 10 * ( t -= 1 ) ) * Math . sin ( ( t * d - s ) * ( 2 * Math . PI ) / period ) ) + b ; } ; } static param { number } amplitude param { number } period memberof static _ElasticOutWith ( amplitude = 0 , period = 0 ) { return function ( t , b , c , d ) : number { t /= 1000 ; d /= 1000 ; if ( t == 0 ) return b ; if ( ( t /= d ) == 1 ) return b + c ; if ( ! period ) period = d * 0.3 ; var s ; if ( ! amplitude || amplitude < Math . abs ( c ) ) { amplitude = c ; s = period / 4 ; } else s = period / ( 2 * Math . PI ) * Math . asin ( c / amplitude ) ; return amplitude * Math . pow ( 2 , - 10 * t ) * Math . sin ( ( t * d - s ) * ( 2 * Math . PI ) / period ) + c + b ; } ; } static param { number } amplitude param { number } period memberof static _ElasticInOutWith ( amplitude = 0 , period = 0 ) { return function ( t , b , c , d ) : number { t /= 1000 ; d /= 1000 ; if ( t == 0 ) return b ; if ( ( t /= d / 2 ) == 2 ) return b + c ; if ( ! period ) period = d * ( 0.3 * 1.5 ) ; var s ; if ( ! amplitude || amplitude < Math . abs ( c ) ) { amplitude = c ; s = period / 4 ; } else s = period / ( 2 * Math . PI ) * Math . asin ( c / amplitude ) ; if ( t < 1 ) return - 0.5 * ( amplitude * Math . pow ( 2 , 10 * ( t -= 1 ) ) * Math . sin ( ( t * d - s ) * ( 2 * Math . PI ) / period ) ) + b ; return amplitude * Math . pow ( 2 , - 10 * ( t -= 1 ) ) * Math . sin ( ( t * d - s ) * ( 2 * Math . PI ) / period ) * 0.5 + c + b ; } ; } static param { number } amplitude param { number } period memberof static _ElasticOutInWith ( amplitude = 0 , period = 0 ) { return function ( t , b , c , d ) : number { t /= 1000 ; d /= 1000 ; var s ; c /= 2 ; if ( t < d / 2 ) { if ( ( t *= 2 ) == 0 ) return b ; if ( ( t /= d ) == 1 ) return b + c ; if ( ! period ) period = d * 0.3 ; if ( ! amplitude || amplitude < Math . abs ( c ) ) { amplitude = c ; s = period / 4 ; } else s = period / ( 2 * Math . PI ) * Math . asin ( c / amplitude ) ; return amplitude * Math . pow ( 2 , - 10 * t ) * Math . sin ( ( t * d - s ) * ( 2 * Math . PI ) / period ) + c + b ; } else { if ( ( t = t * 2 - d ) == 0 ) return ( b + c ) ; if ( ( t /= d ) == 1 ) return ( b + c ) + c ; if ( ! period ) period = d * 0.3 ; if ( ! amplitude || amplitude < Math . abs ( c ) ) { amplitude = c ; s = period / 4 ; } else s = period / ( 2 * Math . PI ) * Math . asin ( c / amplitude ) ; return - ( amplitude * Math . pow ( 2 , 10 * ( t -= 1 ) ) * Math . sin ( ( t * d - s ) * ( 2 * Math . PI ) / period ) ) + ( b + c ) ; } } ; } static memberof static _ElasticIn : Function = Ease24 . _ElasticInWith ( ) ; static memberof static _ElasticOut : Function = Ease24 . _ElasticOutWith ( ) ; static memberof static _ElasticInOut : Function = Ease24 . _ElasticInOutWith ( ) ; static memberof static _ElasticOutIn : Function = Ease24 . _ElasticOutInWith ( ) ; static param { Function } easeA param { Function } easeB param { Function } mixing param { number } start param { number } end memberof static _Blend ( easeA , easeB , mixing , start = 0 , end = 1 ) { return function ( t , b , c , d ) : number { var v1 = easeA ( t , b , c , d ) ; var v2 = easeB ( t , b , c , d ) ; var v3 = mixing ( t , b , c , d ) ; var rate = end - start ; return v1 + ( v2 - v1 ) * ( v3 * rate + start ) ; } ; } }