Outils pour utilisateurs

Outils du site


fractale_de_lyapunov

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
Dernière révisionLes deux révisions suivantes
fractale_de_lyapunov [2019/11/17 05:10] – [C++] Mushussufractale_de_lyapunov [2019/11/17 20:16] – [Processing] Mushussu
Ligne 107: Ligne 107:
     system(fonction.c_str());     system(fonction.c_str());
     return 0;     return 0;
 +}
 +</code>
 +
 +====== Processing =====
 +<code java>
 +
 +int iteration = 20000;
 +int valMin = 0;
 +
 +void setup() {
 +size(200, 200);
 +}
 +
 +void draw() {
 +println(hour() + ":" + minute() + ":" + second());
 +loadPixels();
 +for (int i = 0; i < width; i++) {
 + for (int j = 0; j < height; j++) {
 +   float a = map(i, 0, width, 1.8, 2.2);
 +   float b = map(j, 0, height, 3.6,4);
 +   float seq[] = {a, a, a, a, b, b, b, b, b,b ,b , b,b , b, b, b, b, b, b, b}; // AAABBBBBAB
 +   float[]  A = new float[iteration];
 +   A[0]= 0.5;
 +   for (int k = 1; k < iteration; k++) {
 +     A[k] = seq[k % seq.length] * A[k - 1] * (1 - A[k - 1]);
 +   }
 +   float exposant = 0;
 +   for (int k = 1; k < iteration; k++) {
 +     exposant += log(abs(seq[k % seq.length] * (1 - 2 * A[k])));
 +   }
 +   exposant = exposant / iteration;
 +
 +   int c;
 +   if ((exposant > 0) || (exposant < -1)) {
 +     c = 0;
 +   } else {
 +     c = floor(map(exposant, 0, -1, 255, 0));
 +   }
 +   pixels[i + j * width] = color(c);
 + }
 +}
 +updatePixels();
 +saveFrame("Lyapunov" + "-" + year() + "-" + month() + "-" + day() + "-" + hour() + "-" + minute() + "-" + second() + ".png");
 +println(hour() + ":" + minute() + ":" + second());
 +exit(); 
 } }
 </code> </code>
Ligne 119: Ligne 164:
  
 https://www.scratchapixel.com/lessons/digital-imaging/simple-image-manipulations https://www.scratchapixel.com/lessons/digital-imaging/simple-image-manipulations
-{{tag>c++ sylvain}}+{{tag>c++ Processing sylvain}}
fractale_de_lyapunov.txt · Dernière modification : 2020/04/07 16:53 de Mushussu