Kamil Ondrousek
/
Ikeda
Ikeda fractal
Diff: main.cpp
- Revision:
- 0:0375805b4605
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Jan 16 20:27:22 2011 +0000 @@ -0,0 +1,33 @@ +#include "TFT_4DGL.h" + +TFT_4DGL lcd(p9,p10,p11); + +int main() { + + double u,x,y,t,xa,ya; + + int xout = 0; + int yout = 0; + + u = 0.8; + + xa = 0.1; + ya = 0.1; + + t = 0.4-6.0/(1+(xa*xa)+(ya*ya)); + + while (1) { + + x = 1 + u*(xa*cos(t)-ya*sin(t)); + y = u*(xa*sin(t) + ya*cos(t)); + t = 0.4-6.0/(1+(x*x)+(y*y)); + + xout = 20+(x*145); + yout = 195+(y*140); + + lcd.pixel(xout,yout,WHITE); + + xa = x; + ya = y; +} +} \ No newline at end of file