xxxxxxxxxx
34
/*
Based on Alexander Miller’s video on Recreating Vintage Computer Art with Processing, an excellent introduction to creative coding with parametric equations and inspired by John Whitney's work:
https://www.youtube.com/watch?v=LaarVR1AOvs&t=181s
*/
let t = 1;
function setup() {
createCanvas(windowWidth, windowHeight);
strokeWeight(2);
stroke(255);
}
function draw() {
background(0, 20);
translate(width / 2, height / 2);
let amplitude = width/6;
let x1 = amplitude * cos(t / 10);
let y1 = amplitude * sin(t / 10);
let x2 = (amplitude * 2) * cos(t / 20);
let y2 = (amplitude * 2) * sin(t / 10);
line(x1, y1, x2, y2);
t++;
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
background(0);
}