Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float a, b, c, d, x, y, xp, yp;
- PFont f;
- void setup() {
- size(1500, 1000);
- f = createFont("Arial", 16, true);
- a = 0.59;
- b = 3;
- c = -1.4;
- d = 1.2;
- xp = random(-2, 2);
- yp = random(-2, 2);
- background(0);
- fill(255, 0, 0);
- noStroke();
- textFont(f, 20);
- text("a = " + str(a) + "\nb = " + str(b) + "\nc = " + str(c) + "\nd = " + str(d), 10, 30);
- }
- void draw() {
- //background(0);
- for (int j = 0; j < 100; j++) {
- xp = random(-2, 2);
- yp = random(-2, 2);
- for (int i = 0; i < 100000; i++) {
- x = sin(yp * b) - c * sin(xp * b);
- y = sin(xp * a) + d * sin(yp * a);
- if (i > 5000) {set(int(map(a, 0.59, 0.75, 0, 1500)), int(map(y, -3, 3, 1000, 0)), color(255));}
- xp = x;
- yp = y;
- }
- a += 0.00001;
- println(a);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement