title: mandlebrot fractal error in the plotted function
body: <p>Hello guys i am trying plotting the mandlebrot fractal but the result is very far from it, can you help me to find the why?</p>
  
  <p>Here is the code:</p>
  
  <pre><code>void Button1Click(object sender, EventArgs e)
  {
      Graphics g = pbx.CreateGraphics();
      Pen p = new Pen(Color.Black);
  
      double xmin = -2.0;
      double ymin = -1.2;
      double xmax = 0;
      double ymax = 0;
      double x = xmin, y = ymin;
      int MAX = 1000;
  
      double stepY = Math.Abs(ymin - ymax)/(pbx.Height);
      double stepX = Math.Abs(xmin - xmax)/(pbx.Width);
  
      for(int i = 0; i &lt; pbx.Width; i++)
      {
          y = ymin;
          for(int j = 0; j &lt; pbx.Height; j++)
          {
              double rez = x;
              double imz = y;
              int iter = 0;
  
              while(rez * rez + imz * imz &lt;= 4 &amp;&amp; iter &lt; MAX)
              {
                  rez = rez * rez - imz * imz + x;
                  imz = 2 * rez * imz + y;
                  iter++;
              }
              if(iter == MAX)
              {
                  p.Color = Color.Black;
                  g.DrawRectangle(p, i, j, 1, 1);
              }
              else
              {
                  p.Color = Color.White;
                  g.DrawRectangle(p, i, j, 1, 1);
              }
              y += stepY;
          }
          x += stepX;
      }
  }
  </code></pre>
  
  <p>please help me my mind is getting crushed thinking how to get the beautiful mandlebrot set...
  and sorry if i committed some mistakes but English is not my speaked language! </p>