Skip to content

Instantly share code, notes, and snippets.

@funwithflutter
Created March 23, 2020 13:02
Show Gist options
  • Save funwithflutter/203d622e663448838d151e01aeeb6e01 to your computer and use it in GitHub Desktop.
Save funwithflutter/203d622e663448838d151e01aeeb6e01 to your computer and use it in GitHub Desktop.
Spring curve class
class SpringCurve extends Curve {
const SpringCurve({
this.a = 0.15,
this.w = 19.4,
});
final double a;
final double w;
@override
double transformInternal(double t) {
return -(pow(e, -t / a) * cos(t * w)) + 1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment