Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (int i = 0; i < iterationSlider.getValue(); i++) {
- double cx, cy;
- double rand = Math.random();
- if (rand < 0.01) {
- cx = 0;
- cy = 0.16 * y;
- } else if (rand < 0.86) {
- cx = 0.85 * x + 0.04 * y;
- cy = -0.04 * x + 0.85 * y + 1.6;
- } else if (rand < 0.94) {
- cx = 0.2 * x - 0.26 * y;
- cy = 0.23 * x + 0.22 * y + 1.6;
- } else {
- cx = -0.15 * x + 0.28 * y;
- cy = 0.26 * x + 0.24 * y + 0.44;
- }
- x = (double) cx;
- y = (double) cy;
- g2d.fillRect((int) (x * ((double) (this.getWidth() / 11))), (int) (y * ((double) (this.getHeight() / 11))), 1, 1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement