Created
May 31, 2017 04:58
-
-
Save idimiter/c4aaa753ea885301544ff33b3eef0691 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#include <stdio.h> | |
#include <math.h> | |
float kyp(float t, float kypLength) { | |
return fabs( sin(t * 9.45) * ((t > 0.33 && t < 0.66)? kypLength : 1) ); | |
} | |
float easeIn(float t, float strength) { | |
return pow(t, strength); | |
} | |
float easeOut(float t, float strength) { | |
return 1 - pow(1 - t, strength); | |
} | |
int main() { | |
for (int i = 0; i < 100; i++) { | |
float t = i / 100.0f; | |
float y = easeIn(t, 3); | |
printf("%.2f\n", y); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment