Skip to content

Instantly share code, notes, and snippets.

@idimiter
Created May 31, 2017 04:58
Show Gist options
  • Save idimiter/c4aaa753ea885301544ff33b3eef0691 to your computer and use it in GitHub Desktop.
Save idimiter/c4aaa753ea885301544ff33b3eef0691 to your computer and use it in GitHub Desktop.
#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