Aizawa chaotic system

Committer:
JLS
Date:
Wed Mar 09 21:31:16 2011 +0000
Revision:
0:18b2474ec07b

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
JLS 0:18b2474ec07b 1 #include "TFT_4DGL.h"
JLS 0:18b2474ec07b 2
JLS 0:18b2474ec07b 3 TFT_4DGL lcd(p9,p10,p11);
JLS 0:18b2474ec07b 4
JLS 0:18b2474ec07b 5 int main() {
JLS 0:18b2474ec07b 6
JLS 0:18b2474ec07b 7 int xp,yp;
JLS 0:18b2474ec07b 8
JLS 0:18b2474ec07b 9 int n = WHITE;
JLS 0:18b2474ec07b 10
JLS 0:18b2474ec07b 11 float x,y,z;
JLS 0:18b2474ec07b 12
JLS 0:18b2474ec07b 13 float a = 0.95;
JLS 0:18b2474ec07b 14 float b = 0.7;
JLS 0:18b2474ec07b 15 float c = 0.6;
JLS 0:18b2474ec07b 16 float d = 3.5;
JLS 0:18b2474ec07b 17 float e = 0.25;
JLS 0:18b2474ec07b 18 float f = 0.1;
JLS 0:18b2474ec07b 19
JLS 0:18b2474ec07b 20 float dt = 0.01;
JLS 0:18b2474ec07b 21
JLS 0:18b2474ec07b 22 float x1 = 0.1;
JLS 0:18b2474ec07b 23 float y1 = 0.1;
JLS 0:18b2474ec07b 24 float z1 = 0.1;
JLS 0:18b2474ec07b 25
JLS 0:18b2474ec07b 26
JLS 0:18b2474ec07b 27 x = x1;
JLS 0:18b2474ec07b 28 y = y1;
JLS 0:18b2474ec07b 29 z = z1;
JLS 0:18b2474ec07b 30
JLS 0:18b2474ec07b 31 while(1)
JLS 0:18b2474ec07b 32
JLS 0:18b2474ec07b 33 {
JLS 0:18b2474ec07b 34
JLS 0:18b2474ec07b 35 x = x1+((z1-b)*x1-d*y1)*dt;
JLS 0:18b2474ec07b 36 y = y1+(d*x1+(z1-b)*y1)*dt;
JLS 0:18b2474ec07b 37 z = z1+(c+a*z1-(pow(z1,3)/3)-(pow(x1,2)+pow(y1,2))*(1+e*z1)+f*z1*pow(x1,3))*dt;
JLS 0:18b2474ec07b 38
JLS 0:18b2474ec07b 39 xp = (int)floor(x*95);
JLS 0:18b2474ec07b 40 yp = (int)floor(z*85);
JLS 0:18b2474ec07b 41
JLS 0:18b2474ec07b 42 lcd.pixel(65+yp,160+xp,n);
JLS 0:18b2474ec07b 43
JLS 0:18b2474ec07b 44 x1 = x;
JLS 0:18b2474ec07b 45 y1 = y;
JLS 0:18b2474ec07b 46 z1 = z;
JLS 0:18b2474ec07b 47
JLS 0:18b2474ec07b 48 }
JLS 0:18b2474ec07b 49
JLS 0:18b2474ec07b 50 }