Created
March 23, 2020 12:58
-
-
Save funwithflutter/87e01bd1bc04302636f49a4e409e70ad to your computer and use it in GitHub Desktop.
Sine 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 SineCurve extends Curve { | |
final double count; | |
SineCurve({this.count = 3}); | |
// t = x | |
@override | |
double transformInternal(double t) { | |
var val = sin(count * 2 * pi * t) * 0.5 + 0.5; | |
return val; //f(x) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment