Rossler attractor

Dependencies:   mbed

Committer:
JLS
Date:
Sun Dec 26 19:24:44 2010 +0000
Revision:
1:2fa511a62bd2
Parent:
0:3e96eca5ceb8
update

Who changed what in which revision?

UserRevisionLine numberNew contents of line
JLS 0:3e96eca5ceb8 1 #include "TFT_4DGL.h"
JLS 0:3e96eca5ceb8 2
JLS 0:3e96eca5ceb8 3 TFT_4DGL lcd(p9,p10,p11);
JLS 0:3e96eca5ceb8 4
JLS 0:3e96eca5ceb8 5 int main() {
JLS 0:3e96eca5ceb8 6
JLS 0:3e96eca5ceb8 7 double x1,y1,z1,x,y,z,t,dt;
JLS 0:3e96eca5ceb8 8 int xp,yp;
JLS 0:3e96eca5ceb8 9
JLS 0:3e96eca5ceb8 10 x1=(y1=(z1=(t=0.0001)));
JLS 0:3e96eca5ceb8 11
JLS 0:3e96eca5ceb8 12 dt=0.05;
JLS 0:3e96eca5ceb8 13
JLS 0:3e96eca5ceb8 14 while(1)
JLS 0:3e96eca5ceb8 15
JLS 0:3e96eca5ceb8 16 {
JLS 0:3e96eca5ceb8 17
JLS 0:3e96eca5ceb8 18 x = x1+(-(y1+z1))*dt;
JLS 0:3e96eca5ceb8 19 y = y1+(x1+0.375*y1)*dt;
JLS 0:3e96eca5ceb8 20 z = z1+(2+x1*z1-4*z1)*dt;
JLS 0:3e96eca5ceb8 21 t = t+dt;
JLS 0:3e96eca5ceb8 22
JLS 0:3e96eca5ceb8 23 xp = 135+(int)floor(28*x);
JLS 0:3e96eca5ceb8 24 yp = 160+(int)floor(25*y);
JLS 0:3e96eca5ceb8 25
JLS 0:3e96eca5ceb8 26 lcd.pixel(yp,xp,WHITE);
JLS 0:3e96eca5ceb8 27
JLS 0:3e96eca5ceb8 28 x1 = x;
JLS 0:3e96eca5ceb8 29 y1 = y;
JLS 0:3e96eca5ceb8 30 z1 = z;
JLS 0:3e96eca5ceb8 31
JLS 0:3e96eca5ceb8 32 }
JLS 0:3e96eca5ceb8 33
JLS 0:3e96eca5ceb8 34 }