public void Divide(Term divisor) { if (topLayer is MultiplyDivideLayer) ((MultiplyDivideLayer)topLayer).Divisors.Add(divisor.TopLayer); else { MultiplyDivideLayer newTopLayer = new MultiplyDivideLayer(); newTopLayer.Factors.Add(topLayer); newTopLayer.Divisors.Add(divisor.TopLayer); topLayer = Layer.GetBetterChild(newTopLayer); } }
public void Add(Term addition) { if (topLayer is AddSubtractLayer) ((AddSubtractLayer)topLayer).Additions.Add(addition.TopLayer); else { AddSubtractLayer newTopLayer = new AddSubtractLayer(); newTopLayer.Additions.Add(topLayer); newTopLayer.Additions.Add(addition.TopLayer); topLayer = Layer.GetBetterChild(newTopLayer); } }
public void Divide(Term divisor) { for (int i = 0; i < 2; i++) terms[i].Divide(divisor); }
public void Add(Term addition) { for (int i = 0; i < 2; i++) terms[i].Add(addition); }
public Equation(Term term1, Term term2) { terms = new Term[] { term1, term2 }; }
public void Subtract(Term subtraction) { for (int i = 0; i < 2; i++) terms[i].Subtract(subtraction); }
public void Root(Term nthRoot) { for (int i = 0; i < 2; i++) terms[i].Root(nthRoot); }
public void Power(Term exponent) { for (int i = 0; i < 2; i++) terms[i].Power(exponent); }
public void Multiply(Term factor) { for (int i = 0; i < 2; i++) terms[i].Multiply(factor); }
public void Root(Term nthRoot) { RootLayer rootLayer = new RootLayer(); rootLayer.NthRoot = nthRoot.TopLayer; rootLayer.BaseOfRoot = topLayer; topLayer = rootLayer; }
public void Power(Term exponent) { PowerLayer powerLayer = new PowerLayer(); powerLayer.Exponent = exponent.TopLayer; powerLayer.BaseOfPower = topLayer; topLayer = powerLayer; }