Paul Guitard: Curva

De Casiopea
Revisión del 10:40 12 abr 2012 de Kaikobayashi (discusión | contribs.) (Página creada con '{{Proyecto |Título=Curva Funcion |Tipo de Proyecto=Proyecto de Curso |Palabras Clave=tarea 3 |Año de Inicio=2012 |Carreras Relacionadas=Diseño Gráfico, Diseño Industrial |A...')
(difs.) ← Revisión anterior | Revisión actual (difs.) | Revisión siguiente → (difs.)


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);
  }
}