Mariana Valenzuela función graficada
De Casiopea
Título | Función Gráficada |
---|---|
Tipo de Proyecto | Proyecto de Curso |
Palabras Clave | tarea 3 |
Del Curso | Imagen Escrita 2012, |
Carreras | Arquitectura |
Alumno(s) | Mariana valenzuela |
Profesor | Herbert 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(200, y, width, y+9); } for (float x = xSpacer; x < width; x +=xSpacer) { line(x*y, 79, x, height*4); } } void cruz(float x, float y, float tam) { float t = tam*4; stroke(#01A9DB ); line(x, y, x-y, y-x); stroke (#FF0040); line(y-x, x-y,y, x); // 2 funciones opuestas no se interceptan } void draw() { background(255); grilla(50, 25); /* */ for (int x = 0; x < height; x++) { n = norm(x, 0, height); m = map(mouseX, 0, width, 1, 25); //siguen el mouse en un tramo y en el otro se alejan de él y = pow(n, m) * height; cruz(x, y, x); cruz(x, x-y, y+x); } println(m); // al situar el mouse en la esquina superior izquierda de la pantalla se ven como la esquina del margen con una linea diagonal, al mover el mouse reaccionan curvando estas lineas, similar a parabolas }