Example #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);
        }