Kamil Ondrousek
/
Fractal-Dream
Fractal-Dream chaotic map
main.cpp@0:e3b298a12eea, 2011-01-17 (annotated)
- Committer:
- JLS
- Date:
- Mon Jan 17 21:44:09 2011 +0000
- Revision:
- 0:e3b298a12eea
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
JLS | 0:e3b298a12eea | 1 | #include "TFT_4DGL.h" |
JLS | 0:e3b298a12eea | 2 | |
JLS | 0:e3b298a12eea | 3 | TFT_4DGL lcd(p9,p10,p11); |
JLS | 0:e3b298a12eea | 4 | |
JLS | 0:e3b298a12eea | 5 | int main() { |
JLS | 0:e3b298a12eea | 6 | |
JLS | 0:e3b298a12eea | 7 | double a,b,c,d,x,y,xa,ya; |
JLS | 0:e3b298a12eea | 8 | |
JLS | 0:e3b298a12eea | 9 | int xout = 0; |
JLS | 0:e3b298a12eea | 10 | int yout = 0; |
JLS | 0:e3b298a12eea | 11 | |
JLS | 0:e3b298a12eea | 12 | a = -0.966918; |
JLS | 0:e3b298a12eea | 13 | b = 2.879879; |
JLS | 0:e3b298a12eea | 14 | c = 0.765145; |
JLS | 0:e3b298a12eea | 15 | d = 0.744728; |
JLS | 0:e3b298a12eea | 16 | |
JLS | 0:e3b298a12eea | 17 | xa = 0.1; |
JLS | 0:e3b298a12eea | 18 | ya = 0.1; |
JLS | 0:e3b298a12eea | 19 | |
JLS | 0:e3b298a12eea | 20 | |
JLS | 0:e3b298a12eea | 21 | while (1) { |
JLS | 0:e3b298a12eea | 22 | |
JLS | 0:e3b298a12eea | 23 | x = sin(ya*b)+c*sin(xa*b); |
JLS | 0:e3b298a12eea | 24 | y = sin(xa*a)+d*sin(ya*a); |
JLS | 0:e3b298a12eea | 25 | |
JLS | 0:e3b298a12eea | 26 | xout = 120+(x*60); |
JLS | 0:e3b298a12eea | 27 | yout = 160+(y*95); |
JLS | 0:e3b298a12eea | 28 | |
JLS | 0:e3b298a12eea | 29 | lcd.pixel(xout,yout,WHITE); |
JLS | 0:e3b298a12eea | 30 | |
JLS | 0:e3b298a12eea | 31 | xa = x; |
JLS | 0:e3b298a12eea | 32 | ya = y; |
JLS | 0:e3b298a12eea | 33 | } |
JLS | 0:e3b298a12eea | 34 | } |