Skip to content

Instantly share code, notes, and snippets.

@amyu
Created May 26, 2015 07:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amyu/b3cf6d71908802517ca3 to your computer and use it in GitHub Desktop.
Save amyu/b3cf6d71908802517ca3 to your computer and use it in GitHub Desktop.
public class AttenuationInterpolator implements Interpolator {
public AttenuationInterpolator() {
}
@SuppressWarnings({"UnusedDeclaration"})
public AttenuationInterpolator(Context context, AttributeSet attrs) {
}
@Override
public float getInterpolation(float v) {
//y = -e^-x * cos14.12x + 1
return -1 * (float) Math.pow(Math.E, -3 * v) * (float) Math.cos(20.42034 * v) + 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment