Created
February 17, 2019 20:30
-
-
Save stephanbogner/782c63a2c714db6cd005d9e354633aa6 to your computer and use it in GitHub Desktop.
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
// Different structure of an easing formula from https://github.com/danro/jquery-easing/blob/master/jquery.easing.js for better understanding | |
function easeInOutQuad (currentTime, duration, fromValue, toValue) { | |
var t = currentTime; | |
var b = fromValue; | |
var c = toValue - fromValue; | |
var d = duration; | |
if ((t/=d/2) < 1) return c/2*t*t + b; | |
return -c/2 * ((--t)*(t-2) - 1) + b; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment