Beispiel #1
0
        // formata coeficientes de acordo com sintaxe da url do wolframAlpha
        private string wolframFormat(double[] coeficientes, bool simplified)
        {
            string ret = null;

            // formatar para equacao antes de rotacao e translacao
            if (!simplified)
            {
                if (coeficientes[0] != 0)
                {
                    ret = coeficientes[0].ToString() + "x²+%2B+";                       // A
                }
                if (coeficientes[1] != 0)
                {
                    ret += coeficientes[1].ToString() + "xy+%2B+";                      // B
                }
                if (coeficientes[2] != 0)
                {
                    ret += coeficientes[2].ToString() + "y²+%2B+";                      // C
                }
                if (coeficientes[3] != 0)
                {
                    ret += coeficientes[3].ToString() + "x+%2B+";                       // D
                }
                if (coeficientes[4] != 0)
                {
                    ret += coeficientes[4].ToString() + "y+%2B+"; // E
                }
                ret += coeficientes[5].ToString() + "+%3D0";      // F
            }
            // formatar para equacao depois de rotacao e translacao
            else
            {
                if (coeficientes[0] != 0)
                {
                    ret = funcmat.getAL().ToString() + "u²+%2B+";                        // A
                }
                if (coeficientes[1] != 0)
                {
                    ret += funcmat.getBL().ToString() + "uv+%2B+";                      // B
                }
                if (coeficientes[2] != 0)
                {
                    ret += funcmat.getCL().ToString() + "v²+%2B+";                      // C
                }
                if (coeficientes[3] != 0)
                {
                    ret += funcmat.getDL().ToString() + "u+%2B+";                       // D
                }
                if (coeficientes[4] != 0)
                {
                    ret += funcmat.getEL().ToString() + "v+%2B+"; // E
                }
                ret += funcmat.getF().ToString() + "+%3D0";       // F
            }
            return(ret);
        }
Beispiel #2
0
        private string DetalhesCirc(double[] coeficientes)
        {
            // coordenadas do centro
            double h = funcMat.getH();
            double k = funcMat.getK();

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

            // coordenadas de dx e ey
            double x = funcMat.getAL();
            double y = funcMat.getCL();

            double raio        = Math.Sqrt(Math.Pow(h - x, 2) + Math.Pow(k - y, 2));
            double diametro    = 2 * raio;
            double comprimento = 2 * Math.PI * raio;
            double area        = Math.PI * Math.Pow(raio, 2);

            //raio, centro, diametro, comprimento
            string detalhes = "Centro: C(" + h + "," + k + ")\nRaio:  " + raio + "\nDiametro: " + diametro + "\nComprimento: " + comprimento + "\nArea: " + area;

            return(detalhes);
        }