Created
October 2, 2013 19:25
-
-
Save Chovanec/6799170 to your computer and use it in GitHub Desktop.
easeOutElastic easing function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// t: current time, b: begInnIng value, c: change In value, d: duration | |
function ani ($t, $b, $c, $d) | |
{ | |
$s = 1.70158; | |
$p = 0; | |
$a = $c; | |
if ($t == 0) return $b; | |
if (($t /= $d) == 1) return $b + $c; | |
if (!$p) $p = $d * .3; | |
if ($a < abs($c)) | |
{ | |
$a = $c; | |
$s = $p / 4; | |
} | |
else $s = $p / (2 * pi()) * asin ($c / $a); | |
return $a * pow(2, -10 * $t) * sin(($t * $d - $s) * (2 * pi()) / $p ) + $c + $b; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment