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();
        }
        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();
        }
        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();
        }
        public static void plot(params System.Func <double, double, double>[] fxys)
        {
            var chart3d = new Computator.NET.Charting.Chart3D.UI.Chart3DControl
            {
                Mode = (fxys.Length > 1) ? Computator.NET.Charting.Chart3D.Chart3DMode.Points : Computator.NET.Charting.Chart3D.Chart3DMode.Surface
            };

            chart3d.SetChartAreaValues(-5, 5, -5, 5);

            foreach (var fxy in fxys)//TODO: function name?
            {
                chart3d.AddFunction(new Computator.NET.DataTypes.Function(fxy, Computator.NET.DataTypes.FunctionType.Real3D));
            }

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

            plotForm.Show();
        }
        public static void plot(System.Collections.Generic.IEnumerable <double> x, System.Collections.Generic.IEnumerable <double> y, System.Collections.Generic.IEnumerable <double> z)
        {
            var xa = System.Linq.Enumerable.ToArray(x);
            var ya = System.Linq.Enumerable.ToArray(y);
            var za = System.Linq.Enumerable.ToArray(z);

            var chart3d = new Computator.NET.Charting.Chart3D.UI.Chart3DControl();

            var points = new System.Collections.Generic.List <Computator.NET.DataTypes.Point3D>();
            var n      = System.Math.Min(System.Math.Min(xa.Length, ya.Length), za.Length);

            for (var j = 0; j < n; j++)
            {
                points.Add(new Computator.NET.DataTypes.Point3D(xa[j], ya[j], za[j]));
            }


            chart3d.AddPoints(points);

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

            plotForm.Show();
        }
        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();
        }
Example #7
0
        public void ShowPlotDialog()
        {
            var plotForm = new Computator.NET.Charting.PlotForm(this);

            plotForm.Show();
        }