Kamil Ondrousek
/
Rikitake
Rikitake chaotic system
Diff: main.cpp
- Revision:
- 0:0e1b2bdda33f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Mar 02 18:27:55 2011 +0000 @@ -0,0 +1,46 @@ +#include "TFT_4DGL.h" + +TFT_4DGL lcd(p9,p10,p11); + +int main() { + + int xp,yp; + + int n = WHITE; + + float x,y,z; + + float a = 2; + float s = 10; + float u = 2.1; + + float dt = 0.005; + + float x1 = 0.1; + float y1 = 0.1; + float z1 = 0.1; + + x = x1; + y = y1; + z = z1; + + while(1) + + { + + x = x1+(-u*x1+s*y1*z1)*dt; + y = y1+(-u*y1+(s*z1-a)*x1)*dt; + z = z1+(1-s*x1*y1)*dt; + + xp = (int)floor(x*85); + yp = (int)floor(y*75); + + lcd.pixel(120+yp,160+xp,n); + + x1 = x; + y1 = y; + z1 = z; + + } + +} \ No newline at end of file