示例#1
0
        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);
            }
        }
示例#2
0
        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);
            }
        }
示例#3
0
 public void Divide(Term divisor)
 {
     for (int i = 0; i < 2; i++)
         terms[i].Divide(divisor);
 }
示例#4
0
 public void Add(Term addition)
 {
     for (int i = 0; i < 2; i++)
         terms[i].Add(addition);
 }
示例#5
0
 public Equation(Term term1, Term term2)
 {
     terms = new Term[] { term1, term2 };
 }
示例#6
0
 public void Subtract(Term subtraction)
 {
     for (int i = 0; i < 2; i++)
         terms[i].Subtract(subtraction);
 }
示例#7
0
 public void Root(Term nthRoot)
 {
     for (int i = 0; i < 2; i++)
         terms[i].Root(nthRoot);
 }
示例#8
0
 public void Power(Term exponent)
 {
     for (int i = 0; i < 2; i++)
         terms[i].Power(exponent);
 }
示例#9
0
 public void Multiply(Term factor)
 {
     for (int i = 0; i < 2; i++)
         terms[i].Multiply(factor);
 }
示例#10
0
 public void Root(Term nthRoot)
 {
     RootLayer rootLayer = new RootLayer();
     rootLayer.NthRoot = nthRoot.TopLayer;
     rootLayer.BaseOfRoot = topLayer;
     topLayer = rootLayer;
 }
示例#11
0
 public void Power(Term exponent)
 {
     PowerLayer powerLayer = new PowerLayer();
     powerLayer.Exponent = exponent.TopLayer;
     powerLayer.BaseOfPower = topLayer;
     topLayer = powerLayer;
 }