Daniel Moris: Curva Matemática
De Casiopea
Título | Curva Matemática + Mouse |
---|---|
Tipo de Proyecto | Proyecto de Curso |
Palabras Clave | tarea 3 |
Período | 2012-2012 |
Del Curso | Imagen Escrita 2012, |
Carreras | Arquitectura |
Alumno(s) | Daniel Moris |
Profesor | Herbert Spencer |
Formación de curvas matemáticas que poseen en el fondo una grilla. El grosor del trazo va variando según en qué posición esté el mouse. -------------------- float y, n; // variables float m; void setup() { size(700, 700); } void grilla(int divsX, int divsY) { stroke(200); float xSpacer = width/(float)divsX; float ySpacer = height/(float)divsY; for (float y = ySpacer; y < height; y +=ySpacer) { line(44, y, width-44, y); // esto permite que la grilla no aparezca en el margen, dando una sensación de "enmarcado" } for (float x = xSpacer; x < width; x +=xSpacer) { line(x, 44, x, height-44); // ídem } } void cruz(float x, float y, float tam) { float t = tam*6; stroke(#F9FC63); line(44+x-y, 44+y+t, 44+x-t, 44+y+t*3); stroke(#961EC6); line(x+y, y-t*3, x+t*3, y+t); } void draw() { background(34,78,153); grilla(80, 80); for (int x = 0; x < width; x++) { n = norm(x, 0, mouseY); m = map(mouseX, 0, width, 1, 79); y = pow(n, m) * height * 2; cruz(x+100, y+26, 3); cruz(x, x+y, 5); } println(m); }