Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class Interpolators
- {
- public static double Linear(double In)
- {
- return In;
- }
- public static double LinearOut(double In)
- {
- return 1.0f - In;
- }
- public static double SineIn(double In)
- {
- return Math.Sin(In * (Math.PI / 2));
- }
- public static double SineCurve(double In)
- {
- return Math.Sin(In * (Math.PI));
- }
- public static double SineOut(double In)
- {
- return 1.0f - SineIn(In);
- }
- public static double SmoothStart2(double In)
- {
- return In * In;
- }
- public static double SmoothStop2(double In)
- {
- var Flip = (1f - In);
- return (Flip * Flip);
- }
- public static double SmoothStart3(double In)
- {
- return In * In * In;
- }
- public static double SmoothStop3(double In)
- {
- var Flip = (1f - In);
- return (Flip * Flip * Flip);
- }
- public static double Snap(double In)
- {
- return 1.0f;
- }
- public static Func<double, double> FlatSineCurve(double b = 4) => In =>
- Math.Sqrt(
- (1 + (b * b)) /
- (1 + (b * b) * (Math.Sin(In * Math.PI) * Math.Sin(In * Math.PI)))
- ) * Math.Sin(In * Math.PI);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement