Mathematical formulas to facilitate functions (ElasticEase, CircleEase, BounceEase, BackEase, PowerEase)?

I can find formulas for all polynomial functions, for example, for example. Formula for QuinticEase:

(x - 1) ^ 5 + 1

But what are the math formulas for ElasticEase, CircleEase, BounceEase, BackEase or PowerEase?

All must be in the range 0..1

+4
source share
3 answers

Most formulas can be found on MSDN ; if this is not the case, check the appropriate convenience sub-element.

For more complex functions in which the link does not name the function, you can use a decompiler, for example ILSpy , to look at the EaseInCore methods EaseInCore in the corresponding classes.

+4
source

see this JavaScript project http://jstween.blogspot.com , below you will find a Tween.js file that needs formulas inside.

+6
source

I found a good site containing an implementation in different languages: Robert Penner Weakening functions

For example, Elastic easing C ++ code:

 float Elastic::easeIn (float t,float b , float c, float d) { if (t==0) return b; if ((t/=d)==1) return b+c; float p=d*.3f; float a=c; float s=p/4; float postFix =a*pow(2,10*(t-=1)); // this is a fix, again, with post-increment operators return -(postFix * sin((t*ds)*(2*PI)/p )) + b; } float Elastic::easeOut(float t,float b , float c, float d) { if (t==0) return b; if ((t/=d)==1) return b+c; float p=d*.3f; float a=c; float s=p/4; return (a*pow(2,-10*t) * sin( (t*ds)*(2*PI)/p ) + c + b); } float Elastic::easeInOut(float t,float b , float c, float d) { if (t==0) return b; if ((t/=d/2)==2) return b+c; float p=d*(.3f*1.5f); float a=c; float s=p/4; if (t < 1) { float postFix =a*pow(2,10*(t-=1)); // postIncrement is evil return -.5f*(postFix* sin( (t*ds)*(2*PI)/p )) + b; } float postFix = a*pow(2,-10*(t-=1)); // postIncrement is evil return postFix * sin( (t*ds)*(2*PI)/p )*.5f + c + b; } 
+1
source

All Articles