Esempio n. 1
0
        public Equation SolutionByVariable(string name)
        {
            Function f = new Function();
            Function copy = this.Clone() as Function;

            for (int i = 0; i < copy.variables.Count; i++)
            {
                var vs = copy.variables[i];
                if (vs.HasVariable(name))
                {
                    f += vs;
                    copy.variables.Remove(vs);
                }
            }

            if (f.variables[0].Constant < 0)
            {
                f *= -1;
                copy *= -1;
            }

            var temp = f.ReverseAllFunctionsTo(copy);
            
            return new Equation(temp.Item1 as Function, temp.Item2 as Function);
        }