January 27, 2003
Elastic Tween

I use Robert Penners Tweening Equations in almost all of my projects. So I'm happily surprised that this tread on Flashcoders drove Robert into another great addition to this library. This one creates an elastic bounce tween:

Math.elasticTween = function (t, b, c, d, a, p) {
a = ((c>0 && ac)) ? c : a;
if (p == undefined) p = d / 2;
return ((t==d) ? 0 : -a * (-Math.pow(2, -10 * t/d) + 1) + a) *
Math.sin ((t - p/(2*Math.PI) * Math.asin (c/a)) *
(2*Math.PI) / p) + b + c;

If you have no idea what I'm talking about you can check out Fluid's Tween Playground where you are able to try out all the various tweens (except for the new one).

Posted at January 27, 2003 11:08 PM | Further reading
Post a comment

Email Address:



Remember info?

Thank you!

Most Visited Entries
Sketches, Works & Source Code
In Love with
Powered by
Movable Type 2.661

© Copyright Mario Klingemann

Syndicate this site:
RSS 1.0 - RSS 2.0

Quasimondo @ flickr
Quasimondo @ LinkedIn
Quasimondo @ Twitter
Quasimondo @ Facebook
Quasimondo @ MySpace
Quasimondo is a Bright
Citizen of the TRansnational Republic
My other blog in german

My family name is written Klingemann,
not Klingelmann, Klingeman, Klingaman, Kingemann,
Kindermann, Killingaman, Klingman, Klingmann, Klingonman
Klingemman, Cleangerman, Klingerman or Kleangerman

profile for Quasimondo at Stack Overflow, Q&A for professional and enthusiast programmers