Created
March 23, 2020 13:02
-
-
Save funwithflutter/203d622e663448838d151e01aeeb6e01 to your computer and use it in GitHub Desktop.
Spring curve class
This file contains 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
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