Esempio n. 1
0
        internal override void UpdatePlotData(Telerik.Windows.Data.RadObservableCollection<PlotInfo> dataCollection,
            Plot2DRange plotRange, uint samplesCount)
        {
            if (!this.IsValid)
                return;

            dataCollection.SuspendNotifications();

            dataCollection.Clear();

            double step = (plotRange.XMax - plotRange.XMin) / samplesCount;

            for (double x = plotRange.XMin; x <= plotRange.XMax; x += step)
            {
                double y = this.F(x);
                if (Double.IsInfinity(y) || Double.IsNaN(y))
                    dataCollection.Add(new PlotInfo(x, double.NaN));

                dataCollection.Add(new PlotInfo(x, y));
            }

            dataCollection.ResumeNotifications();
        }