Skip to content

Instantly share code, notes, and snippets.

@maxweisel
Created January 21, 2015 22:53
Show Gist options
  • Save maxweisel/c309903ad10c291fbfb5 to your computer and use it in GitHub Desktop.
Save maxweisel/c309903ad10c291fbfb5 to your computer and use it in GitHub Desktop.
// Takes in a linear value from 0-1. Outputs the ease in/out version of it.
float value = linearValue*2.0;
if (value < 1.0) {
value = 0.5 * powf(value, 2.0);
} else {
value = 1.0 - 0.5 * powf(2.0-value, 2.0);
}
return value;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment