public static float StepFunction(LinearTransformationFunction function, float numberOfFlickerTimes, float time) { float stepSize = 0.01f; float stepValue = 1 / (numberOfFlickerTimes + 1); for (int i = 1; i <= numberOfFlickerTimes; i++) { if ((stepValue * i - stepSize) < time && time < (stepValue * i + stepSize)) { return(0.0f); } } return(function(time)); }
public static float Scale(LinearTransformationFunction function, float time) { return(function(time) * time); }
public static float Mix(LinearTransformationFunction a, LinearTransformationFunction b, float weight, float time) { return(a(time) + weight * (b(time) - a(time))); }
public static float ReverseScale(LinearTransformationFunction function, float time) { return(function(time) * (1.0f - time)); }