Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,20 @@
|
|||
float x, y;
|
||||
float theta;
|
||||
float rotation;
|
||||
|
||||
void setup() {
|
||||
size(300, 300);
|
||||
theta = 0;
|
||||
rotation = 0.1;
|
||||
background(255);
|
||||
}
|
||||
|
||||
void draw() {
|
||||
translate(width/2.0, height/2.0);
|
||||
x = theta*cos(theta/PI);
|
||||
y = theta*sin(theta/PI);
|
||||
point(x, y);
|
||||
theta = theta + rotation;
|
||||
// check restart
|
||||
if (x>width/2.0) frameCount=-1;
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
float theta;
|
||||
float rotation;
|
||||
|
||||
void setup() {
|
||||
size(300, 300);
|
||||
theta = 0;
|
||||
rotation = 0.1;
|
||||
background(255);
|
||||
}
|
||||
|
||||
void draw() {
|
||||
translate(width/2.0, height/2.0);
|
||||
theta += rotation;
|
||||
rotate(theta/PI);
|
||||
point(theta, 0);
|
||||
// check restart
|
||||
if (theta>width/2.0) frameCount=-1;
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
PVector pv;
|
||||
float rotation;
|
||||
|
||||
void setup() {
|
||||
size(300, 300);
|
||||
rotation = 0.1;
|
||||
pv = new PVector(rotation, 0);
|
||||
background(255);
|
||||
}
|
||||
|
||||
void draw() {
|
||||
translate(width/2.0, height/2.0);
|
||||
pv.setMag(pv.mag()+rotation);
|
||||
println(pv.mag());
|
||||
pv.rotate(rotation/PI);
|
||||
point(pv.x, pv.y);
|
||||
// check restart
|
||||
if (pv.mag()>width/2.0) frameCount=-1;
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
float px, py, x, y;
|
||||
float theta;
|
||||
float rotation;
|
||||
|
||||
void setup() {
|
||||
size(300, 300);
|
||||
px = py = x = y = theta = 0;
|
||||
rotation = 0.1;
|
||||
background(255);
|
||||
}
|
||||
|
||||
void draw() {
|
||||
translate(width/2.0, height/2.0);
|
||||
x = theta*cos(theta/PI);
|
||||
y = (theta)*sin(theta/PI);
|
||||
line(x, y, px, py);
|
||||
theta = theta + rotation;
|
||||
px = x;
|
||||
py = y;
|
||||
// check restart
|
||||
if (px>width/2.0) frameCount=-1;
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
float x, y, px, py;
|
||||
float theta;
|
||||
float rotation;
|
||||
|
||||
void setup() {
|
||||
size(300, 300);
|
||||
x = y = px = py = theta = 0;
|
||||
rotation = 0.1;
|
||||
background(255);
|
||||
}
|
||||
|
||||
void draw() {
|
||||
// find coordinates with rotating reference frame
|
||||
pushMatrix();
|
||||
rotate(theta/PI);
|
||||
x = screenX(theta, 0);
|
||||
y = screenY(theta, 0);
|
||||
popMatrix();
|
||||
|
||||
translate(width/2.0, height/2.0);
|
||||
theta += rotation;
|
||||
line(px, py, x, y);
|
||||
px = x;
|
||||
py = y;
|
||||
if (theta>width/2.0) frameCount=-1; // start over
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue