Diferencia entre revisiones de «Francisco Cataldo f(x) graficada que se mueve»

De Casiopea
Sin resumen de edición
Sin resumen de edición
 
Línea 11: Línea 11:
|Imagen=Curvitax.jpg
|Imagen=Curvitax.jpg
}}
}}
Se forma una curva que tiene un patrón, se puede mover con el movimiento del mouse.


<pre><nowiki>
<pre><nowiki>
Línea 17: Línea 18:


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


void cruz(float x, float y, float claw) {
void cruz(float x, float y, float claw) {


float c = claw*5;  
  float c = claw*5;  
stroke(#045F58);
  stroke(#045F58);
line(x, x-c, x/y, y*c);
  line(x, x-c, x/y, y*c);
 
}
}
void draw() {
void draw() {
  background(255); 


background(255)
  for (int x = 0; x < height; x=x+2) {


    n = norm(x, width, 0);
    m = map(mouseX, 0, width, 60, 0);
    y = pow(n, m) * height; 
    cruz(x, y, 2);
  }
  println(m);
  if (key=='s') {
  saveFrame("######.jpg");
}
}


for (int x = 0; x < height; x=x+2) {
  n = norm(x, width, 0);
  m = map(mouseX, 0, width, 60,0);
  y = pow(n, m) * height; 
  cruz(x, y, 2);
}
println(m);
}
</nowiki></pre>
</nowiki></pre>

Revisión actual - 18:01 23 may 2012

Función graficada móvil


TítuloFunción graficada móvil
Tipo de ProyectoProyecto de Curso
Palabras Clavetarea 3, imagen escrita 2012
Período2012-
AsignaturaTaller Inicial 1ª y 2ª Etapa,
Del CursoImagen Escrita 2012,
CarrerasArquitectura
Alumno(s)Francisco Cataldo
ProfesorHerbert Spencer

Se forma una curva que tiene un patrón, se puede mover con el movimiento del mouse.

float y, n;
float m;

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

void cruz(float x, float y, float claw) {

  float c = claw*5; 
  stroke(#045F58);
  line(x, x-c, x/y, y*c);
}
void draw() {
  background(255);  

  for (int x = 0; x < height; x=x+2) {

    n = norm(x, width, 0); 
    m = map(mouseX, 0, width, 60, 0);
    y = pow(n, m) * height;  
    cruz(x, y, 2);
  }
  println(m);
  if (key=='s') {
  saveFrame("######.jpg");
}
}