Modified Celikovsky chaotic system - II

Committer:
JLS
Date:
Wed Mar 30 20:20:28 2011 +0000
Revision:
0:178b94e1f446

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
JLS 0:178b94e1f446 1 #include "TFT_4DGL.h"
JLS 0:178b94e1f446 2
JLS 0:178b94e1f446 3 TFT_4DGL lcd(p9,p10,p11);
JLS 0:178b94e1f446 4
JLS 0:178b94e1f446 5 int main() {
JLS 0:178b94e1f446 6
JLS 0:178b94e1f446 7 int xp,yp;
JLS 0:178b94e1f446 8
JLS 0:178b94e1f446 9 int cnt = 0;
JLS 0:178b94e1f446 10
JLS 0:178b94e1f446 11 int n = WHITE;
JLS 0:178b94e1f446 12
JLS 0:178b94e1f446 13 float x,y,z;
JLS 0:178b94e1f446 14
JLS 0:178b94e1f446 15 float a = 36;
JLS 0:178b94e1f446 16 float b = 3;
JLS 0:178b94e1f446 17 float c = 28;
JLS 0:178b94e1f446 18
JLS 0:178b94e1f446 19 float dt = 0.001;
JLS 0:178b94e1f446 20
JLS 0:178b94e1f446 21 float x1 = 1;
JLS 0:178b94e1f446 22 float y1 = 1;
JLS 0:178b94e1f446 23 float z1 = 1;
JLS 0:178b94e1f446 24
JLS 0:178b94e1f446 25
JLS 0:178b94e1f446 26 x = x1;
JLS 0:178b94e1f446 27 y = y1;
JLS 0:178b94e1f446 28 z = z1;
JLS 0:178b94e1f446 29
JLS 0:178b94e1f446 30 while(1)
JLS 0:178b94e1f446 31
JLS 0:178b94e1f446 32 {
JLS 0:178b94e1f446 33
JLS 0:178b94e1f446 34 x = x1+(a*(y1-x1))*dt;
JLS 0:178b94e1f446 35 y = y1+(-(x1*z1)+(c*y1))*dt;
JLS 0:178b94e1f446 36 z = z1+((x1*y1)-(b*z1))*dt;
JLS 0:178b94e1f446 37
JLS 0:178b94e1f446 38 xp = (int)floor(5*x);
JLS 0:178b94e1f446 39 yp = (int)floor(3*z);
JLS 0:178b94e1f446 40
JLS 0:178b94e1f446 41 cnt ++;
JLS 0:178b94e1f446 42
JLS 0:178b94e1f446 43 if (cnt >= 7400) {
JLS 0:178b94e1f446 44
JLS 0:178b94e1f446 45
JLS 0:178b94e1f446 46 lcd.pixel(yp,155+xp,n);
JLS 0:178b94e1f446 47
JLS 0:178b94e1f446 48 }
JLS 0:178b94e1f446 49
JLS 0:178b94e1f446 50 x1 = x;
JLS 0:178b94e1f446 51 y1 = y;
JLS 0:178b94e1f446 52 z1 = z;
JLS 0:178b94e1f446 53
JLS 0:178b94e1f446 54 }
JLS 0:178b94e1f446 55
JLS 0:178b94e1f446 56 }