title: How can I set the value of c when generating a Mandelbrot fractal?
body: <p>The equation for generating a Mandelbrot fractal is <code>Zn+1 = Zn^2+C</code>. The issue is that, in a computer program, C is used for zoom/resolution and location on screen. My question is, how can I make it so that I can get a fractal like this:</p>
  
  <p><a href="http://mathworld.wolfram.com/MandelbrotSet.html" rel="nofollow noreferrer">Wolfram</a></p>
  
  <p>(<code>equation f(z) = sin(z/c), z0 = c</code> )</p>
  
  <p><a href="https://i.stack.imgur.com/TPIT6.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TPIT6.gif" alt="cassinioval"></a></p>
  
  <p>My code (from <a href="https://rosettacode.org/wiki/Mandelbrot_set#Java" rel="nofollow noreferrer">Rosetta Code</a>):</p>
  
  <pre><code>public class MandelbrotSet extends JFrame {
      private static final long serialVersionUID = 5513426498262284949L;
      private final int MAX_ITER = 570;
      private final double ZOOM = 150;
      private BufferedImage image;
      private double zx, zy, cX, cY, tmp;
  
      public MandelbrotSet() {
          super("Mandelbrot Set");
          setBounds(100, 100, 800, 600);
          setResizable(false);
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          image = new BufferedImage(getWidth(), getHeight(), BufferedImage.TYPE_INT_RGB);
          for (int y = 0; y &lt; getHeight(); y++) {
              for (int x = 0; x &lt; getWidth(); x++) {
                  zx = zy = 0;
                  cX = (x - 400) / ZOOM;
                  cY = (y - 300) / ZOOM;
                  int iter = MAX_ITER;
  
                  while (zx * zx + zy * zy &lt; 4 &amp;&amp; iter &gt; 0) {
                      tmp = zx * zx - zy * zy + cX;
                      zy = 2.0 * zx * zy + cY;
                      zx = tmp;
                      iter--;
                  }
  
                  image.setRGB(x, y, iter | (iter &lt;&lt; 8));
              }
          }
      }
  
          @Override
          public void paint(Graphics g) {
              g.drawImage(image, 0, 0, this);
          }
  
      public static void main(String[] args) {
          new MandelbrotSet().setVisible(true);;
      }
  }
  </code></pre>