Exemplo n.º 1
0
        public static double DenormaliseAsymptoticSmooth(double number, double inMin, double inMax, double outMin, double outMax)
        {
            var variables = new AsymptoteVariables();

            variables.Coefficient = 36;
            variables.XAdjustment = variables.Coefficient + 1;
            variables.YAdjustment = 1.01;
            return(DenormaliseAsymptoticGeneric(number, inMin, inMax, outMin, outMax, variables));
        }
Exemplo n.º 2
0
        private static double DenormaliseAsymptoticGeneric(double number, double inMin, double inMax, double outMin, double outMax, AsymptoteVariables variables)
        {
            var scaled = ScaleIn(number, inMin, inMax);
            var result = (variables.Coefficient / (variables.YAdjustment - scaled)) - variables.XAdjustment;

            if (Double.IsInfinity(result))
            {
                Console.WriteLine("Error: infinity");
            }
            return(ScaleOut(result, outMin, outMax));
        }