Easing equation function for an exponential (2^t) easing in: accelerating from zero velocity. - CSharp System

CSharp examples for System:Math Easing Function

Description

Easing equation function for an exponential (2^t) easing in: accelerating from zero velocity.

Demo Code


using System;// ww w . j a  v  a2s.c o m

public class Main{
        /// <summary>
   /// Easing equation function for an exponential (2^t) easing in: 
   /// accelerating from zero velocity.
   /// </summary>
   /// <param name="t">Current time in seconds.</param>
   /// <param name="b">Starting value.</param>
   /// <param name="c">Change in value.</param>
   /// <param name="d">Duration of animation.</param>
   /// <returns>The correct value.</returns>
   public static double ExpoEaseIn( double t, double b, double c, double d )
   {
      return ( t == 0 ) ? b : c * Math.Pow( 2, 10 * ( t / d - 1 ) ) + b;
   }
}

Related Tutorials