int circleSize = 50; float moveX = 0; float moveY = 0; float a = 0; float b = 0; float moveA = 0; float moveB = 0; void setup() { size(400, 400); background(0); float centerX = width/2; float centerY = height/2; smooth(); /*First Pattern */ translate(350, 10); //fill(0, 0, 255, 50); for (int x=0; x<5; x++) { for (int y=0; y<5; y++) { noStroke(); fill(random(255), random(255), random(255), 50); translate(2-x, 2-x); ellipse(a+moveA, b+moveB, circleSize, circleSize); moveA= moveA-5; moveB = moveB+5; } } for (int x=0; x<5; x++) { for (int y=0; y<5; y++) { noStroke(); fill(random(255), random(255), random(255), 50); translate(2+x*2, 2+x*2); ellipse(a+moveA, b+moveB, circleSize, circleSize); moveA= moveA+5; moveB = moveB-5; } } for (int x=0; x<5; x++) { for (int y=0; y<5; y++) { noStroke(); fill(random(255), random(255), random(255), 50); translate(2-x, 2-x); ellipse(a+moveA, b+moveB, circleSize, circleSize); moveA= moveA-5; moveB = moveB+5; } } for (int x=0; x<5; x++) { for (int y=0; y<5; y++) { noStroke(); fill(random(255), random(255), random(255), 50); translate(2+x*2, 2+x*2); ellipse(a+moveA, b+moveB, circleSize, circleSize); moveA= moveA+5; moveB = moveB-5; } } /*Second Pattern */ translate(-500, -300); //fill(0, 255, 0, 50); for (int x=0; x<5; x++) { for (int y=0; y<5; y++) { noStroke(); fill(random(255), random(255), random(255), 50); translate(2-x, 2-x); ellipse(a+moveA, b+moveB, circleSize, circleSize); moveA= moveA-5; moveB = moveB+5; } } for (int x=0; x<5; x++) { for (int y=0; y<5; y++) { noStroke(); fill(random(255), random(255), random(255), 50); translate(2+x*2, 2+x*2); ellipse(a+moveA, b+moveB, circleSize, circleSize); moveA= moveA+5; moveB = moveB-5; } } for (int x=0; x<5; x++) { for (int y=0; y<5; y++) { noStroke(); fill(random(255), random(255), random(255), 50); translate(2-x, 2-x); ellipse(a+moveA, b+moveB, circleSize, circleSize); moveA= moveA-5; moveB = moveB+5; } } for (int x=0; x<5; x++) { for (int y=0; y<5; y++) { noStroke(); fill(random(255), random(255), random(255), 50); translate(2+x*2, 2+x*2); ellipse(a+moveA, b+moveB, circleSize, circleSize); moveA= moveA+5; moveB = moveB-5; } } /*Third Pattern */ translate(-500, -300); //fill(255, 0, 0, 50); for (int x=0; x<5; x++) { for (int y=0; y<5; y++) { noStroke(); fill(random(255), random(255), random(255), 50); translate(2-x, 2-x); ellipse(a+moveA, b+moveB, circleSize, circleSize); moveA= moveA-5; moveB = moveB+5; } } for (int x=0; x<5; x++) { for (int y=0; y<5; y++) { noStroke(); fill(random(255), random(255), random(255), 50); translate(2+x*2, 2+x*2); ellipse(a+moveA, b+moveB, circleSize, circleSize); moveA= moveA+5; moveB = moveB-5; } } for (int x=0; x<5; x++) { for (int y=0; y<5; y++) { noStroke(); fill(random(255), random(255), random(255), 50); translate(2-x, 2-x); ellipse(a+moveA, b+moveB, circleSize, circleSize); moveA= moveA-5; moveB = moveB+5; } } for (int x=0; x<5; x++) { for (int y=0; y<5; y++) { noStroke(); fill(random(255), random(255), random(255), 50); translate(2+x*2, 2+x*2); ellipse(a+moveA, b+moveB, circleSize, circleSize); moveA= moveA+5; moveB = moveB-5; } } for (int x=0; x<5; x++) { for (int y=0; y<5; y++) { noStroke(); fill(random(255), random(255), random(255), 50); translate(2-x, 2-x); ellipse(a+moveA, b+moveB, circleSize, circleSize); moveA= moveA-5; moveB = moveB+5; } } for (int x=0; x<5; x++) { for (int y=0; y<5; y++) { noStroke(); fill(random(255), random(255), random(255), 50); translate(2+x*2, 2+x*2); ellipse(a+moveA, b+moveB, circleSize, circleSize); moveA= moveA+5; moveB = moveB-5; } } save("Ellipse_Algorithm.jpg"); }