예제 #1
0
        public void DrawMcLaurinNewton(BinaryTree tree)
        {
            this.treeMclA = tree;
            float    xin = p1.Width / 2;
            float    yin = p1.Height / 2;
            Graphics g   = p1.CreateGraphics();

            g.TranslateTransform(xin, yin);
            for (float i = -xin; i <= xin; i++)
            {
                try
                {
                    float x1 = i / this.coef;
                    float x2 = (i + 1) / this.coef;
                    float y1 = (float)tree.CreateMcLaurinPlot(x1);
                    float y2 = (float)tree.CreateMcLaurinPlot(x2);
                    g.DrawLine(Pens.Aqua, x1 * this.coef, -y1 * this.coef, x2 * this.coef, -y2 * this.coef);
                }
                catch (OverflowException)
                {
                }
            }
        }