Eloisa Herrera Espiral Aurea

De Casiopea
Eloisa Herrera Espiral Aurea


TítuloEloisa Herrera Espiral Aurea
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 11
Período2012-2012
Del CursoImagen Escrita 2012,
CarrerasArquitectura
Alumno(s)Eloísa Herrera
ProfesorHerbert Spencer
 
// Construcción del espiral aurea.

void setup() {
size(611, 378);
smooth();
frameRate(10);
}
int[] s = new int[3];
int tmp, phase;
float speed;
void draw() {
background(350, 380, 190);
s[0] = 0;
s[1] = 0;
s[2] = 1; 
phase = 0; 
speed = 0.01;
translate(442, 272);
scale(1.0, -1.0);
rotate(PI);
while (s[2] < 611) {
float wave = sin((frameCount + phase*20) * speed) + 1.0;
fill(0, 0, wave * 64, 10);
stroke(000, wave * 255);
if (phase % 4 == 0) strokeWeight(5); else strokeWeight(1);
arc(s[2], s[2], 2*s[2], 2*s[2], PI, 3*PI/2.0);
if (phase % 4 == 1) strokeWeight(5); else strokeWeight(1);
arc(0, s[2], 2*s[2], 2*s[2], -PI/2.0, 0);
if (phase % 4 == 2) strokeWeight(5); else strokeWeight(1);
arc(0, 0, 2*s[2], 2*s[2], 0, PI/2.0);
if (phase % 4 == 3) strokeWeight(5); else strokeWeight(1);
arc(s[2], 0, 2*s[2], 2*s[2], PI/2.0, PI);
noFill();
stroke(255, 255, 255, 255);
strokeWeight(1);
rect(0, 0, s[2], s[2]);
tmp = s[2];
s[2] += s[1];
s[0] = s[1];
s[1] = tmp;
switch(phase % 4) {
case 0:
translate(s[1], 0);
break;
case 1:
translate(-s[0], s[1]);
break;
case 2:
translate(-s[2], -s[0]);
break;
case 3:
translate(0, -s[2]);
break;
}
phase++;
}
}