-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDistorted_Circles
More file actions
40 lines (36 loc) · 1.21 KB
/
Distorted_Circles
File metadata and controls
40 lines (36 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import processing.svg.*;
int m = minute();
int h = hour();
int s = second();
int d = day();
int mo = month();
int yr = year();
void setup() {
size(500, 500);
beginRecord(SVG, m + "-" + h + "-" + s + "-" + d + ":" + mo + ":" + yr +".svg");
noLoop();
}
void draw() {
background(255);
stroke(0);
strokeWeight(2);
noFill();
for (int j = 0; j < 1 ; j++) {
float radius = random(50, 250); // radius of the circle
float angle = 0; // angle of the circle
float angleStep = TWO_PI / 100; // amount to increment the angle each time
float x = width/2 + radius * cos(angle); // x-coordinate of the circle
float y = height/2 + radius * sin(angle); // y-coordinate of the circle
beginShape();
for (int i = 0; i < 100; i++) {
curveVertex(x, y); // add a curve vertex at the current (x, y) coordinate
angle += angleStep; // increment the angle
x = width/2 + radius * cos(angle); // update the x-coordinate
y = height/2 + radius * sin(angle); // update the y-coordinate
x += random(-10, 10); // add a random horizontal offset
y += random(-10, 10); // add a random vertical offset
}
endShape(CLOSE); // close the shape to create a continuous loop
endRecord();
}
}