![](/media/cache/profiles/03492e99e42e7ea8480cdfb4899604f5.50x50_q85.jpg)
Burke-Shaw chaotic attractor
Diff: main.cpp
- Revision:
- 0:e7733dec1713
diff -r 000000000000 -r e7733dec1713 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Jan 04 20:05:42 2011 +0000 @@ -0,0 +1,38 @@ +#include "TFT_4DGL.h" + +TFT_4DGL lcd(p9,p10,p11); + +int main() { + + double x1,y1,z1,x,y,z,dt; + int xp,yp; + + float u = 11; + float v = 13; + + x1 = 0.6; + y1 = 0; + z1 = 0; + + dt = 0.002; + + while(1) + + { + + x = x1+(-u*x1-u*y1)*dt; + y = y1+(-u*x1*z1-y1)*dt; + z = z1+(u*x1*y1+v)*dt; + + xp = 160+(int)floor(35*x); + yp = 120+(int)floor(14*y); + + lcd.pixel(yp,xp,WHITE); + + x1 = x; + y1 = y; + z1 = z; + + } + +} \ No newline at end of file