/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://studio.sketchpad.cc/sp/pad/view/ro.-pzzqTWXdxD/rev.2138
*
* authors:
* Kevin cando
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
float starttime = ((((((
year()-2000)*12+month())*31+day())
*24+hour())*60)+minute())*60+second();
int n = 257;
void setup() {
// canvas size (Variable aren't evaluated. Integers only, please.)
size(600, 600);
background(0);
// smooth edges
smooth();
// limit the number of frames per second
frameRate(30);
noStroke();
}
void draw() {
// clear the background
fill(0, 100);
rect(0, 0, width, height);
float time = starttime + millis()*0.001;
//text( time, 10, height-10 );
translate(width/2, height/2);
for( int i=1; i<=n; ++i ) {
float s = float(i)/n;
fill( 255 * (1.0 - s), 255 * s, 255 );
float t_i = time * s;
float r = (1.0 + sin(t_i*1.618034)) * width/5 + width/20;
//r = s * width/2.5 + width/20;
float a = t_i - 0.5*time;
ellipse( r*cos(a), r*sin(a), 5, 5 );
}
}