Beispiel #1
0
    public void should_correctly_calculate_sine_curve_value(float slope, float xShift, float yShift, float inputValue, float expectedValue)
    {
        var curve       = new SineCurveFunction(slope, xShift, yShift);
        var actualValue = curve.Plot(inputValue);

        Assert.Equal(expectedValue.ToString("F"), actualValue.ToString("F"));
    }
Beispiel #2
0
 public static SineCurveFunction Alter(this SineCurveFunction curve, float?slope = null, float?xShift = null, float?yShift = null)
 {
     return(new SineCurveFunction(
                slope.HasValue ? slope.Value : curve.Slope,
                xShift.HasValue ? xShift.Value : curve.XShift,
                yShift.HasValue ? yShift.Value : curve.YShift
                ));
 }