Gabriela Torres: curva en gráfico

De Casiopea
Revisión del 22:41 24 abr 2012 de Gabi (discusión | contribs.)
(difs.) ← Revisión anterior | Revisión actual (difs.) | Revisión siguiente → (difs.)
{{{Título}}}



Título
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 3
Del CursoImagen Escrita 2012,
CarrerasArquitectura
Alumno(s)Gabriela Torres
ProfesorHerbert Spencer
float y, n;  
float m;     
void setup() {
  size(700, 700);
}

void grilla(int divsX, int divsY) {
  stroke(240); 

  float xSpacer = width/(float)divsX;  
  float ySpacer = height/(float)divsY; 

  for (float y = ySpacer; y < height; y +=ySpacer) {
    line(0, y, width, y);  
  }
  for (float x = xSpacer; x < width; x +=xSpacer) {
    line(x, 0, x, height); 
  }
}


void cruz(float x, float y, float tam) {
  float t = tam/6; 
  stroke(#00c0ff);
  line(x, y+2, x+x, x);
  stroke (#ff3f00);
  line(y, x, x, y);
}

void draw() {
  background(255);  
  grilla(60, 60);    


  for (int x = 0; x < width; x++) {

    n = norm(x, 0, width);  
    m = map(mouseX, 0, width, 1, 60); 
   y = pow(n, m) * height;   
 
    cruz(x,y*4,y);
    cruz(x/2, height-y, x);
  }
  println(m); 
}