xxxxxxxxxx
41
/*
Based on the lissajous curve example from Code as a Creative Medium
https://github.com/CodeAsCreativeMedium/exercises/blob/main/09_curves/06_lissajous/lissajous_js/lissajous_js.js
Lissajous curve:
https://en.wikipedia.org/wiki/Lissajous_curve
*/
let t = 0;
function setup() {
createCanvas(windowWidth, windowHeight);
stroke(255,100,100);
strokeWeight(30);
}
function draw() {
background(0, 5);
let minDimension = min(width, height);
let radius = (minDimension * 3) / 8;
x = cos((3 * t) / 2) * radius + width / 3;
y = sin((2 * t) / 4) * radius + height / 3;
x2 = cos((3 * t) / 2) * radius + width *2/3;
y2 = sin((2 * t) / 4) * radius + height *2/3;
point(x, y);
point(x2, y2);
// point(x3,y3);
t += 0.1;
}
function windowResized() {
resizeCanvas(windowWidth, windowHeight);
background(0);
}