float g = 0.8 * 2.0; float l = 10.0; float t = 0; void setup() { size(320, 240); noStroke(); smooth(); } void loop() { float omega0 = sqrt(g / l); float theta0 = 2.0; float theta = theta0 * cos(omega0 * t); float x = (width / 2) + l * sin(theta) * 10.0; float y = (height / 2) + l * cos(theta) * 10.0; fill(0xff, 0xff, 0xff, 0x33); rect(0, 0, width, height); fill(0xff, 0, 0); ellipse(x - 5, y - 5, 10, 10); t += 0.1; }