Skip to content

Instantly share code, notes, and snippets.

@Bleuje
Last active January 5, 2023 22:53
float easeOutElastic(float x)
{
float c4 = (2*PI)/3;
if(x<=0) return 0;
if(x>=1) return 1;
return pow(2, -10 * x) * sin((x * 10 - 0.75) * c4) + 1;
}
// in-out easing of strength g
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
else
return 1 - 0.5 * pow(2*(1 - p), g);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment