public void Plot(PlotableFunction f, double min, double max) { LineItem ln = new LineItem(f.Name, GetPoints(f, min, max), linecolor, SymbolType.None); ln.Line.Style = f.DashStyle; ln.Line.Width = f.LineWidth; zgc.GraphPane.CurveList.Clear(); zgc.GraphPane.CurveList.Add(ln); zgc.AxisChange(); zgc.Invalidate(); }
private IPointList GetPoints(PlotableFunction f, double min, double max) { List <double> x = new List <double>(); List <double> y = new List <double>(); for (double xi = min; xi < max; xi += dx) { x.Add(xi); y.Add(f.F(xi)); } return(new BasicArrayPointList(x.ToArray(), y.ToArray())); }