Пример #1
0
        public static void plot(System.Collections.Generic.IEnumerable <double> x, System.Collections.Generic.IEnumerable <double> y)
        {
            var chart2d = new Computator.NET.Charting.RealCharting.Chart2D();

            chart2d.AddDataPoints(System.Linq.Enumerable.ToList(y), System.Linq.Enumerable.ToList(x));
            var plotForm = new Computator.NET.Charting.PlotForm(chart2d);

            plotForm.Show();
        }
Пример #2
0
        public static void plot(System.Func <double, double> fx, params System.Collections.Generic.IEnumerable <double>[] xys)
        {
            var chart2d = new Computator.NET.Charting.RealCharting.Chart2D();

            chart2d.AddFunction(new Computator.NET.DataTypes.Function(fx, Computator.NET.DataTypes.FunctionType.Real2D));
            for (int i = 0; i < xys.Length - 1; i++)
            {
                chart2d.AddDataPoints(System.Linq.Enumerable.ToList(xys[i]), System.Linq.Enumerable.ToList(xys[i + 1]));
            }

            var plotForm = new Computator.NET.Charting.PlotForm(chart2d);

            plotForm.Show();
        }
Пример #3
0
        public static void plot(params System.Func <double, double>[] fxs)
        {
            var chart2d = new Computator.NET.Charting.RealCharting.Chart2D();

            chart2d.SetChartAreaValues(-5, 5, -5, 5);
            chart2d.Quality = 0.5 * 100;

            foreach (var fx in fxs)//TODO: function name?
            {
                chart2d.AddFunction(new Computator.NET.DataTypes.Function(fx, Computator.NET.DataTypes.FunctionType.Real2D));
            }

            var plotForm = new Computator.NET.Charting.PlotForm(chart2d);

            plotForm.Show();
        }
Пример #4
0
        public static void plot(Computator.NET.DataTypes.Function f, double XMin = -5, double XMax = 5, double YMin = -5,
                                double YMax = 5, double quality = 0.5)
        {
            Computator.NET.DataTypes.Charts.IChart chart;

            switch (f.FunctionType)
            {
            case Computator.NET.DataTypes.FunctionType.Real2D:
            case Computator.NET.DataTypes.FunctionType.Real2DImplicit:
                chart = new Computator.NET.Charting.RealCharting.Chart2D();
                break;

            case Computator.NET.DataTypes.FunctionType.Real3D:
            case Computator.NET.DataTypes.FunctionType.Real3DImplicit:
                chart = new Computator.NET.Charting.Chart3D.UI.Chart3DControl();
                break;

            case Computator.NET.DataTypes.FunctionType.Complex:
            case Computator.NET.DataTypes.FunctionType.ComplexImplicit:
                chart = new Computator.NET.Charting.ComplexCharting.ComplexChart();
                break;

            case Computator.NET.DataTypes.FunctionType.Scripting:
            default:
                throw new System.ArgumentOutOfRangeException();
            }


            chart.SetChartAreaValues(XMin, XMax, YMin, YMax);
            chart.Quality = quality * 100;

            chart.AddFunction(f);

            var plotForm = new Computator.NET.Charting.PlotForm(chart);

            plotForm.Show();
        }