xxxxxxxxxx
15
function setup() {
createCanvas(400, 400);
}
function draw() {
background(200);
var period = 1000; // milliseconds
var percent = (millis()%period)/period;
var xA = 0;
var xB = width;
var px = lerp(xA, xB, percent);
ellipse(px, 200, 40, 40);
}