xxxxxxxxxx
17
function setup() {
createCanvas(400, 400);
}
function draw() {
background(200);
var period = 1000.0; // milliseconds
var angle = TWO_PI * millis()/period;
var center = width/2;
var amplitude = 100;
var frequency = 1.0;
var phase = 0;
var px = center + amplitude * sin(phase + frequency * angle);
ellipse(px, 200, 40, 40);
}