Ejemplo n.º 1
0
        /// <summary>
        /// This will take the value and normalize it based off the maxValue then plot it and denormalize it
        /// </summary>
        /// <param name="curve">Curve type to use</param>
        /// <param name="value">The value to be normalized and plotted</param>
        /// <param name="maxValue">The maximum value used when scaling</param>
        /// <returns>The denormalized value from the curve</returns>
        public static float ScaledPlot(this ICurveFunction curve, float value, float maxValue)
        {
            var normalizedValue  = (value + float.Epsilon) / maxValue;
            var normalizedOutput = curve.Plot(normalizedValue);

            return(normalizedOutput * maxValue);
        }
Ejemplo n.º 2
0
        public static float Random(this IRandomizer randomizer, ICurveFunction curve)
        {
            var randomNumber = randomizer.Random();

            return(curve.Plot(randomNumber));
        }