Advertisement
Guest User

Untitled

a guest
May 3rd, 2016
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1.         for (int i = 0; i < iterationSlider.getValue(); i++) {
  2.             double cx, cy;
  3.             double rand = Math.random();
  4.             if (rand < 0.01) {
  5.                 cx = 0;
  6.                 cy = 0.16 * y;
  7.             } else if (rand < 0.86) {
  8.                 cx = 0.85 * x + 0.04 * y;
  9.                 cy = -0.04 * x + 0.85 * y + 1.6;
  10.             } else if (rand < 0.94) {
  11.                 cx = 0.2 * x - 0.26 * y;
  12.                 cy = 0.23 * x + 0.22 * y + 1.6;
  13.             } else {
  14.                 cx = -0.15 * x + 0.28 * y;
  15.                 cy = 0.26 * x + 0.24 * y + 0.44;
  16.             }
  17.             x = (double) cx;
  18.             y = (double) cy;
  19.             g2d.fillRect((int) (x * ((double) (this.getWidth() / 11))), (int) (y * ((double) (this.getHeight() / 11))), 1, 1);
  20.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement