Example #1
0
  private void drawJuliaLine() {
    int x0, y0, x1 = 0, y1 = 0, list_size;

    Graphics2D full_image_g = image.createGraphics();

    pixel_orbit.calculateJuliaOrbit();

    full_image_g.setColor(orbit_color);

    full_image_g.setRenderingHint(
        RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    list_size = complex_orbit.size() - 1;

    double size = pixel_orbit.getSize();
    int image_size = ptr.getImageSize();

    double temp_xcenter_size = pixel_orbit.getXCenter() - size / 2;
    double temp_ycenter_size = pixel_orbit.getYCenter() - size / 2;
    double temp_size_image_size = size / image_size;

    for (int i = 0; i < list_size; i++) {
      x0 = (int) ((complex_orbit.get(i).getRe() - temp_xcenter_size) / temp_size_image_size);
      y0 = (int) ((complex_orbit.get(i).getIm() - temp_ycenter_size) / temp_size_image_size);
      x1 = (int) ((complex_orbit.get(i + 1).getRe() - temp_xcenter_size) / temp_size_image_size);
      y1 = (int) ((complex_orbit.get(i + 1).getIm() - temp_ycenter_size) / temp_size_image_size);
      full_image_g.drawLine(x0, y0, x1, y1);
      full_image_g.fillOval(x0, y0, 3, 3);
    }

    full_image_g.fillOval(x1, y1, 3, 3);
  }
Example #2
0
  private void drawJuliaDot() {
    int x0, y0, list_size;

    Graphics2D full_image_g = image.createGraphics();

    pixel_orbit.calculateJuliaOrbit();

    full_image_g.setColor(orbit_color);

    full_image_g.setFont(new Font("Arial", 1, 11));
    list_size = complex_orbit.size();

    double size = pixel_orbit.getSize();
    int image_size = ptr.getImageSize();

    double temp_xcenter_size = pixel_orbit.getXCenter() - size / 2;
    double temp_ycenter_size = pixel_orbit.getYCenter() - size / 2;
    double temp_size_image_size = size / image_size;

    for (int i = 0; i < list_size; i++) {
      x0 = (int) ((complex_orbit.get(i).getRe() - temp_xcenter_size) / temp_size_image_size);
      y0 = (int) ((complex_orbit.get(i).getIm() - temp_ycenter_size) / temp_size_image_size);
      full_image_g.drawString(".", x0 - 1, y0 + 1);
    }
  }
Example #3
0
 public static void main(String[] args) {
   System.out.println("Started");
   Fractal fractal = new Fractal();
   fractal.run();
   fractal.generateSVG();
   Logger.generateFile();
   System.out.println("Finished");
 }