Easing equation function for a sinusoidal (sin(t)) easing out: decelerating from zero velocity. - CSharp System

CSharp examples for System:Math Easing Function

Description

Easing equation function for a sinusoidal (sin(t)) easing out: decelerating from zero velocity.

Demo Code


using System;/*from w ww  . j  a  va2 s .com*/

public class Main{
        /// <summary>
   /// Easing equation function for a sinusoidal (sin(t)) easing out: 
   /// decelerating 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 SineEaseOut( double t, double b, double c, double d )
   {
      return c * Math.Sin( t / d * ( Math.PI / 2 ) ) + b;
   }
}

Related Tutorials