Bárbara Valdivia función graficada
De Casiopea
Título | Función graficada |
---|---|
Tipo de Proyecto | Proyecto de Curso |
Palabras Clave | tarea 3 |
Período | 2012- |
Del Curso | Imagen Escrita 2012, |
Carreras | Arquitectura |
Alumno(s) | Bárbara Valdivia |
Profesor | Herbert Spencer |
// Se logra el dibujo el cual puede ser intervenido con el movimiento del mouse, cambiando su forma.
float y, n; float m; void setup() { size(700, 700); } void grilla(int divsX, int divsY) { stroke(#E3F7F0); float xSpacer = width/(float)divsX; float ySpacer = height/(float)divsY; for (float y = ySpacer; y < height; y +=ySpacer) { line(400, y, width, y+7); } for (float x = xSpacer; x < width; x +=xSpacer) { line(x, 50, x, height*9); } } void cruz(float x, float y, float tam) { float t = tam/2; stroke(#20D33C); line(x-t, y-t, x+t, 0); stroke(#E03F90); line(x-t, y+t, 1, y-t); } void draw() { background(255); grilla(40, 20); for (int x = 0; x < width; x++) { n = norm(x, 0, width); m = map(mouseX, 0, width, 1, 40); y = pow(n, m) * height; cruz(x, y, 6); cruz(x, height-y, 6); saveFrame ("Bbvv3.jpg"); } println(m); }