fractale_de_lyapunov
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
fractale_de_lyapunov [2019/11/17 05:05] – [C++] Mushussu | fractale_de_lyapunov [2020/04/07 16:53] (Version actuelle) – Mushussu | ||
---|---|---|---|
Ligne 3: | Ligne 3: | ||
===== C++ ===== | ===== C++ ===== | ||
<code c++> | <code c++> | ||
+ | // Compilation : g++ Lyapunov.cpp -o Lyapunov | ||
+ | // Execution | ||
+ | |||
#include < | #include < | ||
#include < | #include < | ||
Ligne 29: | Ligne 32: | ||
return 0; | return 0; | ||
} | } | ||
+ | // Initialisation des constantes | ||
sequence = argv[1]; | sequence = argv[1]; | ||
for (int i = 0; i < 4; i++) { | for (int i = 0; i < 4; i++) { | ||
Ligne 37: | Ligne 41: | ||
iteration = stoi(argv[8]); | iteration = stoi(argv[8]); | ||
limite = stof(argv[9]); | limite = stof(argv[9]); | ||
+ | |||
time_t debut, fin; | time_t debut, fin; | ||
time(& | time(& | ||
+ | |||
float tableau[iteration]; | float tableau[iteration]; | ||
tableau[0]= 0.5; | tableau[0]= 0.5; | ||
Ligne 54: | Ligne 60: | ||
bValeur[i] = proportion(i, | bValeur[i] = proportion(i, | ||
} | } | ||
+ | |||
+ | // Formation du nom du fichier | ||
string nom = " | string nom = " | ||
for (int i = 0; i < 4; i++) { | for (int i = 0; i < 4; i++) { | ||
Ligne 64: | Ligne 72: | ||
} | } | ||
nom += " | nom += " | ||
+ | |||
+ | // Création de l' | ||
ofstream image(nom); | ofstream image(nom); | ||
image << " | image << " | ||
Ligne 90: | Ligne 100: | ||
} | } | ||
} | } | ||
+ | |||
+ | |||
time(& | time(& | ||
cout << " | cout << " | ||
Ligne 95: | Ligne 107: | ||
system(fonction.c_str()); | system(fonction.c_str()); | ||
return 0; | return 0; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ====== Processing ===== | ||
+ | <code java> | ||
+ | |||
+ | int iteration = 20000; | ||
+ | int valMin = 0; | ||
+ | |||
+ | void setup() { | ||
+ | size(200, 200); | ||
+ | } | ||
+ | |||
+ | void draw() { | ||
+ | println(hour() + ":" | ||
+ | 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 | ||
+ | | ||
+ | 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++) { | ||
+ | | ||
+ | } | ||
+ | | ||
+ | |||
+ | int c; | ||
+ | if ((exposant > 0) || (exposant < -1)) { | ||
+ | c = 0; | ||
+ | } else { | ||
+ | c = floor(map(exposant, | ||
+ | } | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | updatePixels(); | ||
+ | saveFrame(" | ||
+ | println(hour() + ":" | ||
+ | exit(); | ||
} | } | ||
</ | </ | ||
===== Liens ===== | ===== Liens ===== | ||
- | https:// | + | [[https:// |
- | https:// | + | [[https:// |
=== PPM === | === PPM === | ||
- | https:// | + | [[https:// |
- | https:// | + | [[https:// |
- | {{tag> | + | {{tag> |
fractale_de_lyapunov.1573967106.txt.gz · Dernière modification : 2019/11/17 05:05 de Mushussu