cocos2d/cocos2d-iphone — pull request #298 by nader-eloshaiker (2013-03-06 19:15:45+00:00)
Title: The issue with exponential functions is that they exhibit asymptotes.

Please ignore my previous pull request, it was going to the wrong branch.... Sorry, not an experienced user of github.
https://github.com/cocos2d/cocos2d-iphone/pull/297

*** Description of issue and solution ***

The effects of the asymptotes become visible when performing large changes over a short time.
i.e. rotate 10000 degrees in 2.5 seconds with an exponential ease out, the effect is that as it comes to a stop, it jumps to its final position.

ExponentialEaseOut will asymptote at newT = 1 while ExponentialEaseIn will asymptote at newT = 0, hence the original version hard coded these values for newT.

I have replaced the exponential mathematical routine with a nth order polynomial which resembles an exponential curve for values of 0 <= t <= 1 and an order of 6.
The advantage of using polynomial curves is that they do not asymptote.
I have allowed for odd and even values of polynomial orders as odd values will exhibit an inflection in the curve.

As a feature of this curve, you can now control the acceleration at which it eases in or out by adjusting the polynomial value, polynomial must be greater than 1.

*** Code Details ***

- added an abstract class called CCEaseExponential where it will store polynomial order, inflection attribute and intersect point for InOut action based on the polynomial order
- added property for abstract class to change the order of the polynomial to control acceleration of the ease function
- Modified CCEaseExponentialIn to use polynomial curves of newT = t^n where n > 1
- Modified CCEaseExponentialOut to use polynomial curves of newT = (t - 1)^n + 1 where n > 1 and is an odd integer, newT = -( (t - 1)^n ) + 1 where n > 1 and is an even integer
- Modified CCEaseExponentialInOut (for 0 <= t < 0.5) to use polynomial curves of newT = (t * intersect)^n where n > 1,
- Modified CCEaseExponentialInOut (for 0.5 <= t <= 1) to use polynomial curves of newT = ( (t - 1) * intersect)^n + 1 where n > 1 and is an odd integer, newT = -( ( (t - 1) * * intersect ) ^n ) + 1 where n > 1 and is an even integer