Celikovsky chaotic system

Dependencies:   mbed

Committer:
JLS
Date:
Mon Mar 28 20:06:53 2011 +0000
Revision:
0:a2fd829cf01b

        

Who changed what in which revision?

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