Isadora Aubel: IE - 4
De Casiopea
Título | Identidad Circular |
---|---|
Asignatura | Imagen Escrita |
Del Curso | Imagen Escrita 2017 |
Nº | 4 |
Alumno(s) | Isadora Aubel |
<processingjs>
float inc; //incremento
int sides=2048; //lados
void setup() {
size(500, 500); inc= TWO_PI/ float (sides); stroke(100); mouseX = width/2; mouseY = height/2;
}
void draw() {
background(255); if (mousePressed) { stroke (#D83B3B);//cambio de color al presionar mouse beginShape();
for (float t=0; t<5*TWO_PI; t+=inc) {//t=theta (angulo) float a = map(mouseX, 0, width, 1, 8); float n = map(mouseY, 0, height, 0, .5); float r = 30*a*cos(n*t);// formula curva polar: ROSE (segun math wolfram) r=a*sin(n*t)
float x= width/2 +cos(t)*r; float y= height/2 + sin(t)*r;
point(x, y); } endShape(); } else { stroke (0); beginShape();
for (float t=0; t<5*TWO_PI; t+=inc) { float a = map(mouseX, 0, height, 1, 8); float n = map(width, 0, mouseY, 2, 4); float r = 50*a*cos(n*t);
float x= width/2 +cos(t)*r; float y= height/2 + sin(t)*r;
point(x, y); } endShape(); }
} </processingjs>