/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://studio.sketchpad.cc/sp/pad/view/ro.LKQVSg704mp/rev.497
*
* authors:
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
* Fergus Ray Murray
*
*
*
*
*
*
*
*
*
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
float x, y, seed=5.2195, f; // Each seed value gives a different fractal.
double df=0, ddf=TWO_PI*seed, dddf=0.0000001; // dddf controls how much the fractal changes with each frame.
int i=0;
void setup() { // 'setup' is called just once, when the program is run.
size(300, 300); // Tell Processing how big a window it should use.
}
void draw() { // 'draw' is called every time the program draws a frame.
// We need to reset most of the variables every frame.
x=width/2;
y=height/2;
x2=width/3;
y2=height/3;
f=0;
df=0;
background(255); // This fills in the frame with a white background.
for (i=0; i<10000; i+=1) { // Repeat the next block times.
f+=df-.1*sin(df);
df+=ddf;
x+=cos(f);
y+=sin(f);
stroke(134,i/10000*255,255 - i/10000*255);
point(x, y);
x2+=cos(f*3);
y2+=sin(f+f);
point(x2,y2);
}
ellipse(x+385.56*sin(ddf*385.56), y+385.56*cos (ddf*385.56),64, 64);
ddf+=dddf; // So ddf changes every frame, causing animation to happen.
}