title: Generate Julia Set Escape values for a circle with a radius of 2 in c++
body: <p>I have to generate escape values for a circle with a radius of 2 to for a Julia set. Here is my code, I am generating values but they are way off from what they should be. What am I doing wrong here?</p>
  
  <pre><code>int main() {
  double width = 5;
  double height = 5;
  double a = .271;
  double b = .314;
  double it = 9;
  string name = Julia.txt
  myfile.open(name);
  double new_x = 4 / (width-1);
  double new_y = 4 / (height-1);
  for (int y = 0; y &lt; height; y++) {
      for (int x = 0; x &lt; width; x++) {
          double y0 = 2 - (y*new_y);
          double x0 = -2 + (x*new_x);
          for (double i = 0; i &lt; it; i++) {
              new_x = x0;
              new_y = y0;
              x0 = (new_x*new_x - (new_y*new_y)) + a;
              y0 = (2 * new_x*new_y) + b;
              if (((x0 * x0) + (y0 * y0)) &gt; 4) {
                  myfile &lt;&lt; x0, y0; 
                  break; 
              }
          }
      }
  }
  myfile.close(); 
  return 0;
  }
  </code></pre>
  
  <p>it should write </p>
  
  <pre><code>5 5 9
  0 0 0 0 0 
  0 2 7 1 0 
  0 2 9 2 0 
  0 1 7 2 0 
  0 0 0 0 0
  </code></pre>
  
  <p>to the file but instead I am getting </p>
  
  <pre><code>0.271-7.68612.271-15.68696.271-39.6861020.27-127.68616896.3-519.6864.2710.31412.271-15.686100.2710.3141020.27-127.68616900.30.3140.271-7.68612.27116.31464.271-119.686924.271640.31416416.3-5719.69-4091.73256.314-37619.7-1551.69-33630011600.3-3.03354e+06-111488-2.72733e+071.35824e+06-4.36726e+08-83591.7-6.98729e+09668720-1.11798e+11-6.68724e+06-1.78876e+128.55965e+07-2.86202e+13-1.39094e+09
  </code></pre>