/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://studio.sketchpad.cc/sp/pad/view/ro.9tgcx0m3nMK/rev.519
*
* authors:
* Ben Brandt
*
*
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
float a = 0;
float b = 0;
float c = 0;
float co = 0;
void setup() {
background(255);
colorMode(HSB, 100);
size(500, 400);
smooth();
strokeWeight(3);
frameRate(1000);
}
float margin;
void draw() {
stroke(co, 80, 80, 2);
margin = map (sin(c),-1,1,20, 100);
float x0 = map(sin(a), -1, 1, margin, width - margin);
float y0 = map(cos(a), -1, 1, margin, height - margin);
float x1 = map(sin(b), -1, 1, margin, width - margin);
float y1 = map(cos(b), -1, 1, margin, height - margin);
//background(100);
//stroke(0);
//point(x0, y0);
//point(x1, y1);
line(x0, y0, x1, y1);
//ellipse(x0, y0, 20, 20);
//ellipse(x1, y1, 20, 20);
a = a + 0.009; //random(1.000001, 3.000001)/30;
b = b + 0.04;
c = c + 0.003;
co = co + 1;
if (co > 100) {
co = 0;
}
}