Esempio n. 1
0
        public void PaintChart(Function.functionFromX function, Graphics graphics)
        {
            bool   first  = true;
            PointF point1 = new PointF();

            for (float x = -maxX; x <= maxX; x += dxFor)
            {
                float y = function(x);
                if (float.IsNaN(y))
                {
                    continue;
                }
                if (first)
                {
                    point1 = GetTruePoint(x, y);
                    first  = false;
                }
                else
                {
                    PointF point = GetTruePoint(x, y);
                    CallBy(graphics, point1, point);
                    point1 = point;
                }
            }
        }
Esempio n. 2
0
        private void RunBtn_Click(object sender, EventArgs e)
        {
            g = this.CreateGraphics();
            Function function = new Function(functionInputTextBox.Text);

            func = function.func;
            paintChart(g);
            this.Resize += Paint_Form;
        }