public void should_correctly_calculate_normal_curve_value(float slope, float xShift, float yShift, float verticalSize, float inputValue, float expectedValue) { var curve = new NormalCurveFunction(slope, xShift, yShift, verticalSize); var actualValue = curve.Plot(inputValue); Assert.Equal(expectedValue.ToString("F"), actualValue.ToString("F")); }
public static NormalCurveFunction Alter(this NormalCurveFunction curve, float?slope = null, float?xShift = null, float?yShift = null, float?exponent = null) { return(new NormalCurveFunction( slope.HasValue ? slope.Value : curve.Slope, xShift.HasValue ? xShift.Value : curve.XShift, yShift.HasValue ? yShift.Value : curve.YShift, exponent.HasValue ? exponent.Value : curve.Exponent )); }