public static List <DoublePoint> GetPointsList(Rpn rpn, double xStart, double xEnd, double step, double zoom) { var output = new List <DoublePoint>(); Rpn localRpn; double x = xStart; do { double y = rpn.GetNewRpnWithSetVariable(x * zoom).Calculate() / zoom; output.Add(new DoublePoint(x, y)); x += step; } while (x <= xEnd); return(output); }
static double GetY(Rpn rpn, double x) { return(rpn.GetNewRpnWithSetVariable(x).Calculate()); }