Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup() {
- size(800, 800);
- background(255);
- float sw=0;
- float theta = 0;
- int centX = width/2;
- int centY = height/2;
- stroke(20, 50, 70);
- float radius = 5;
- float x, y;
- float lastx = -999;
- float lasty = -999;
- for (float ang = 0; ang <= 8*360; ang += 4) {
- sw = map(sin(theta*1.5), -1, 1, 4, 40);
- strokeWeight(sw);
- radius += 0.8;
- float rad = radians(ang);
- x = centX + (radius * cos(rad));
- y = centY + (radius * sin(rad));
- if (lastx > -999) {
- line(x, y, lastx, lasty);
- }
- lastx = x;
- lasty = y;
- theta += 0.05;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment