Beispiel #1
0
        private bool translacao()
        {
            funcmat.calculaH_K(coeficientes);
            det = funcmat.acharSolucoesSistema(coeficientes[0], coeficientes[1], coeficientes[2]);
            if (det == 0) // Poder ter infinitas soluções ou ser incompativel
            {
                if (double.IsNaN(funcmat.getH()) || double.IsNaN(funcmat.getK()))
                {
                    // Sistema incompativel
                }
                if (double.IsInfinity(funcmat.getH()) || double.IsInfinity(funcmat.getK()))
                {
                    // Sistema com infinitas soluções
                }

                // Não conseguiu eliminar os termos lineares
                matrizG2 = funcmat.gerarEquacaoG2(coeficientes[0], coeficientes[1], coeficientes[2], coeficientes[3], coeficientes[4], coeficientes[5]);
                return(false); // não conseguiu realizar a translação
            }

            matrizG2 = funcmat.gerarEquacaoG2(coeficientes[0], coeficientes[1], coeficientes[2], coeficientes[3], coeficientes[4], coeficientes[5]);
            // Conseguiu realizar a translação, então remover os termos lineares
            funcmat.setDL(0);
            funcmat.setEL(0);
            return(true);
        }
Beispiel #2
0
        private string DetalhesParabol(double[] coeficientes)
        {
            string detalhes = null;

            // C(X,Y)

            double h = funcMat.getH();
            double k = funcMat.getK();

            if (!h.IsFinite() || !k.IsFinite())
            {
                h = 0;
                k = 0;
            }
            double p;
            double eixo;

            // vamos verificar onde esta o eixo da parabola

            // se temos coeficiente de x^2, eixo de simetria em y
            // x^2 = 4py
            if (coeficientes[0] != 0)
            {
                // termo linear no ey
                p    = (coeficientes[4]) / 4;
                eixo = k;

                detalhes  = "\nFoco: F(" + (h) + "," + (-(k + p)) + ")";
                detalhes += "\nDiretriz r: y= " + (p);
                detalhes += "\n Parametro: p= " + (-p);
                detalhes += "\nEixo: x= " + eixo;
            }
            // se temos coeficiente de y^2, eixo de simetria em x\
            // y^2 = 4px
            else if (coeficientes[2] != 0)
            {
                // termo linear no dx
                p    = (coeficientes[3]) / 4;
                eixo = h;


                detalhes  = "\nFoco: F(" + (-(h + p)) + "," + (k) + ")";
                detalhes += "\nDiretriz r: x= " + (p);
                detalhes += "\n Parametro: p= " + (-p);
                detalhes += "\nEixo: y= " + eixo;
            }

            return(detalhes);
        }