int a = 0;
int b = 0;
int fibonacci = 0;
int total = 14;
int i = 0;
size(600, 400);
background(#FF9681);
fill(0, 0, 0, 0);
smooth();
translate(384, 148);
for (i=0; i < total; i++) {
if (i ==0) {
fibonacci =0;
} else if (i ==1 ) {
fibonacci =1;
} else {
a = b;
b = fibonacci;
fibonacci = a+b;
}
println(fibonacci+"");
rotate(PI/2);
translate(b, -b);
rect(0, 0, fibonacci, fibonacci);
scale(1,-1);
translate(0,-fibonacci);
arc(0,0,fibonacci*2,fibonacci*2,0,PI/2);
translate(0,fibonacci);
scale(1,-1);
}
int b = 0;
int fibonacci = 0;
int total = 14;
int i = 0;
size(600, 400);
background(#FF9681);
fill(0, 0, 0, 0);
smooth();
translate(384, 148);
for (i=0; i < total; i++) {
if (i ==0) {
fibonacci =0;
} else if (i ==1 ) {
fibonacci =1;
} else {
a = b;
b = fibonacci;
fibonacci = a+b;
}
println(fibonacci+"");
rotate(PI/2);
translate(b, -b);
rect(0, 0, fibonacci, fibonacci);
scale(1,-1);
translate(0,-fibonacci);
arc(0,0,fibonacci*2,fibonacci*2,0,PI/2);
translate(0,fibonacci);
scale(1,-1);
}
Book reference :
Parametric Design for architecture
0 comments:
Post a Comment