Paul Guitard: Curva

De Casiopea
La versión para imprimir ya no se admite y puede contener errores de representación. Actualiza los marcadores del navegador y utiliza en su lugar la función de impresión predeterminada del navegador.
Curva Funcion


TítuloCurva Funcion
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 3
Período2012-
AsignaturaTaller Inicial Común 1ª y 2ª Etapa,
Del CursoImagen Escrita 2012,
CarrerasDiseño Gráfico"Diseño Gráfico" is not in the list (Arquitectura, Diseño, Magíster, Otra) of allowed values for the "Carreras Relacionadas" property., Diseño Industrial"Diseño Industrial" is not in the list (Arquitectura, Diseño, Magíster, Otra) of allowed values for the "Carreras Relacionadas" property.
Alumno(s)Paul Guitard
ProfesorHerbert Spencer
float y, n; 
float m;     

void setup() {
  size(700, 700);
}

void grilla(int divsX, int divsY) {

  stroke(255);  

  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; 
  stroke(240, 20, 20, 50);
  line(x-t, y-t, x+t, y+t);
  line(x-t, y+t, x+t, y-t);
}

void draw() {
  background(0); 
  grilla(2, 2); 

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

    n = norm(x, 0, width); 
    m = map(mouseX, 0, width, 1, 40);
    y = pow(n, m) * height;

    cruz(x, 0, 50);
    cruz(x, height-y, 50);
  }
}