Пример #1
0
        /// acceleration until halfway, then deceleration
        /// http://robertpenner.com/easing/
        public static float FunctionEaseInOutExpo(float t, float p = 10)
        {
            var s = FloatMath.Pow(2, -2 * p) / 2;
            var e = 1 - FloatMath.Pow(2, -p) / 2;

            if (t < 0.5)
            {
                return((FloatMath.Pow(2, p * (2 * t - 1)) / 2 - s) / (e - s));
            }
            return((1 - FloatMath.Pow(2, -p * (2 * t - 1)) / 2 - s) / (e - s));
        }
Пример #2
0
 /// decelerating to zero velocity
 /// http://robertpenner.com/easing/
 public static float FunctionEaseOutExpo(float t, float p = 10)
 {
     return((1 - FloatMath.Pow(2, -p * t)) / (1 - FloatMath.Pow(2, -p)));
 }
Пример #3
0
        /// accelerating from zero velocity
        /// http://robertpenner.com/easing/
        public static float FunctionEaseInExpo(float t, float p = 10f)
        {
            var s = FloatMath.Pow(2, -p);

            return((FloatMath.Pow(2, p * (t - 1)) - s) / (1 - s));
        }