Example #1
0
 //esta x se calcula con calcular X
 //TERMINA METODO CALCULAR YK
 //EMPIEZA METODO CALCULAR COLA
 public double calcularCola(double x, double numeroDeDatos)
 {
     CalcularIntegral C = new CalcularIntegral();
     double valorP = C.Integra(x, 10, numeroDeDatos - 2);
     double cola = (1 - (2 * valorP));
     return cola;
 }
Example #2
0
        //EMPIEZA METODO OBTENERX
        //public double terminos(double x, double num_seg, double dof)
        public double obtenerX(double pBusc, double dof)
        {
            CalcularIntegral C = new CalcularIntegral();
            double x = 1;
            double var = .5;
            double num_seg = 10;
            double p = C.Integra(x, num_seg, dof);
            //while ((p - .00001) != pBusc || (p + .00001) != pBusc || c < 20)
            while (Math.Round(p, 5) != pBusc)
            {
                while(p < pBusc)
                {
                    x = x + var;
                    p = C.Integra(x, num_seg, dof);
                }
                if(p > pBusc)
                {
                    var = var/2;
                    while(p > pBusc)
                    {
                        x = x - var;
                        p = C.Integra(x, num_seg, dof);
                    }
                    var = var/2;
                }else
                {
                    var = var/2;
                }

            }
            return Math.Round(x, 5);
        }