> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://dflab.sketchpad.cc/sp/pad/view/ro.7n1V82hiMuz/rev.140
 * 
 * authors: 
 *   Raquel Correia

 * license (unless otherwise specified): 
 *   creative commons attribution-share alike 3.0 license.
 *   https://creativecommons.org/licenses/by-sa/3.0/ 
 */ 



float px = 0;
float py = 150;
 
float vx = 3;
 
float amplitude = 150;
float freq = 0.5;
float t;
 
void setup() {  
    size(300, 300); 
    background(57,3,3);
    stroke (196,126,14,30);
    strokeWeight(30);
} 
 
void draw() {
    // background(255); 
 
    t = millis() / 1000.0;
 
    float npx = px + vx;
    float npy = 150 + (amplitude * sin (t * TWO_PI * freq));
 
    line (px, py, npx, npy);
    
    px = npx;
    py = npy;
    
    if (px > width) {
        px = 0;
    }
}