/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://studio.sketchpad.cc/sp/pad/view/ro.A1KhZrSSTYG/rev.1194
*
* authors:
* Leo
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
int a = 0;
int b = 0;
int x1 = 0;
int y1 = 0;
int x2 = 0;
int y2 = 0;
int radx = 100;
int rady = 100;
int speed = 0.03;
void setup() {
a = 9.4;
b = a * 2;
size(500, 300);
background(3, 22, 52);
}
void draw() {
noStroke();
fill(3, 22, 52, 10);
rect(0, 0, width, height);
fill(205 + y1, 179 + y1, 128 + y1);
radx = Math.cos(a - b / 5) * 150;
rady = Math.cos(a / b) * 150;
x1 = width / 2 + Math.cos(a)*radx;
y1 = height / 2 + Math.sin(a)*rady;
ellipse(x1, y1, 30, 30);
fill(3 + y2, 101 + y2, 100 + y2);
x2 = width / 2 + Math.cos(b)*radx;
y2 = height / 2 + Math.sin(b)*rady;
ellipse(x2, y2, 30, 30);
a += speed;
b += speed;
}