Skip to content

Instantly share code, notes, and snippets.

@kvannotten
Created October 2, 2010 16:51
Show Gist options
  • Save kvannotten/607791 to your computer and use it in GitHub Desktop.
Save kvannotten/607791 to your computer and use it in GitHub Desktop.
float linearTween(float t, float start, float end){
return t * start + (1-t) * end;
}
float QuadraticEaseInOut(float t, float start, float end){
float middle = (start + end) / 2;
t = 2 * t;
if (t <= 1)
return linearTween(t*t, start, middle);
t-= 1;
return linearTween(t*t, middle, end);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment