/**************************************************************** * Power Expression ***************************************************************/ public Node PowExpression() { var expr1 = NegExpression(); if (CurrentToken == TokenCategory.EXPONENT) { var expr2 = new Power() { AnchorToken = Expect(TokenCategory.EXPONENT) }; expr2.Add(expr1); expr2.Add(PowExpression()); expr1 = expr2; } return(expr1); }
public void Add(double x, double y) { Power.Add(new KeyValuePair <double, double>(x, y)); double xmin = Power.Min(kvp => kvp.Key); double xmax = Power.Max(kvp => kvp.Key); double ymin = Power.Min(kvp => kvp.Value); double ymax = Power.Max(kvp => kvp.Value); double yavg = Power.Average(kvp => kvp.Value); PowerAvg.Clear(); PowerAvg.Add(new KeyValuePair <double, double>(xmin, yavg)); PowerAvg.Add(new KeyValuePair <double, double>(xmax, yavg)); }