xxxxxxxxxx
32
/*
----- Coding Tutorial by Patt Vira -----
Name: Oscillation - Coding Math
Video Tutorial: https://youtu.be/CIl8xSg3HbA?si=Vqp-Xt0LRAHisJiT
Connect with Patt: @pattvira
https://www.pattvira.com/
----------------------------------------
*/
let x; let y; let r = 100; let angle = 0;
let t = 0;
function setup() {
createCanvas(400, 400);
angleMode(DEGREES);
background(220);
}
function draw() {
x = r*cos(angle);
y = r*sin(angle);
translate(0, height/2);
noStroke();
fill(0);
ellipse(t, x, 10, 10);
fill(255, 0, 0);
ellipse(t, y, 10, 10);
angle += 1;
t += 1;
}