动画曲线 EaseIn | EaseOut |EaseInOut 数学模型分析

 
  1. #define pow2(x) ((x)*(x))
  2. #define pow3(x) ((x)*(x)*(x))
  3. // assuming :
  4. // t is a value between 0 and 1
  5. // b is an offset
  6. // c is the height
  7. public double easeIn (double t, double b, double c) {
  8.   return c*pow3(t) + b;
  9. }
  10. public double easeOut (double t, double b, double c) {
  11.   return c*(pow3(t-1) + 1) + b;
  12. }
  13. public double easeInOut (double t, double b, double c) {
  14. if ( (t*2) < 1)
  15.   return c/2*pow3(t*2) + b;
  16. else
  17.   return c/2*(pow3(t*2-2) + 2) + b;
  18. }


一套tween算法代码 : http://monw3c.blogbus.com/logs/57106239.html






Tween


Tween类型:

ease类型:


算法分析 : 

http://www.cnblogs.com/mrsunny/archive/2011/06/21/2086080.html




你可能感兴趣的:(Algorithm)