First attempt to Coxcomb
in
Share your Work
•
2 years ago
Hi, everyone
Following with my silly experiments while learning Processing and programming.
Trying to understand and apply this:
I came up with this:
size(480, 280);
smooth();
int items = 3;
float angulo = 360/items;
//Valor de cada item
int valorA = 4;
int valorB = 2;
int valorC = 7;
float rA = sqrt(items*valorA/PI)*100;
print(rA);
float rB = sqrt(items*valorB/PI)*100;
print(rB);
float rC = sqrt(items*valorC/PI)*100;
print(rB);
float anguloFigura = angulo;
noStroke();
fill(255, 0,0);
arc(width/2, height/2, rA, rA, radians(270), radians(anguloFigura + 270));
fill(0, 255, 0);
arc(width/2, height/2, rB, rB, radians(anguloFigura + 270), radians(anguloFigura*2 + 270));
fill(0, 0, 255);
arc(width/2, height/2, rC, rC, radians(anguloFigura*2 + 270), radians(anguloFigura*3 + 270));
things I learned:
arcs;
variables;
operator;
sqrt function
I know there is a lot of things to improve (like good names for variables), but remember that I'm just learning...