Kamil Ondrousek
/
2D-Lorenz
Lorenz limit cycle - 2D nonlinear attractor
main.cpp
- Committer:
- JLS
- Date:
- 2011-02-08
- Revision:
- 0:337717573fe7
File content as of revision 0:337717573fe7:
#include "TFT_4DGL.h" TFT_4DGL lcd(p9,p10,p11); int main() { int xp,yp; int n = WHITE; float x,y,xn,yn; float dt = 0.55; float x1 = 0.1; float y1 = 0; x = x1; y = y1; while(1) { xn = x1-y1-pow(x1,3); yn = x1-(x1*x1)*y1; x = x+xn*dt; y = y+yn*dt; xp = (int)floor(x*65); yp = (int)floor(y*110); lcd.pixel(120+xp,160+yp,n); x1 = x; y1 = y; } }