Exemplo n.º 1
0
        public static List <DataPoint> Create(MathActionDouble functionX, MathActionDouble functionY, int ptsCount)
        {
            var result = new List <DataPoint>();

            for (double i = 0; i < ptsCount; i++)
            {
                result.Add(new DataPoint()
                {
                    XVals = functionX(i),
                    YVals = functionY(i)
                });
            }
            return(result);
        }
Exemplo n.º 2
0
        public static List <DataPoint> Create(MathActionDouble function, double from, double to, double step)
        {
            var result = new List <DataPoint>();
            var count  = (to - from) / step;

            for (double r = from; r < to; r += step)
            {
                result.Add(new DataPoint()
                {
                    XVals = r,
                    YVals = function(r)
                });
            }
            return(result);
        }
        public static DataTable Create(MathActionDouble functionX, MathActionDouble functionY, int ptsCount)
        {
            var result = new DataTable();

            result.Columns.Add(new DataColumn("XVals", typeof(double)));
            result.Columns.Add(new DataColumn("YVals", typeof(double)));

            for (double i = 0; i < ptsCount; i++)
            {
                DataRow dr = result.NewRow();
                dr[0] = functionX(i);
                dr[1] = functionY(i);
                result.Rows.Add(dr);
            }
            return(result);
        }
        public static DataTable Create(MathActionDouble function, double from, double to, double step)
        {
            var result = new DataTable();

            result.Columns.Add(new DataColumn("XVals", typeof(double)));
            result.Columns.Add(new DataColumn("YVals", typeof(double)));

            var count = (to - from) / step;

            for (double r = from; r < to; r += step)
            {
                DataRow dr = result.NewRow();
                dr[0] = r;
                dr[1] = function(r);
                result.Rows.Add(dr);
            }
            return(result);
        }