Popcorn fractal map

Dependencies:   mbed

Revision:
0:732044ed2f1d
Child:
1:77a27904e76e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Dec 25 20:01:32 2010 +0000
@@ -0,0 +1,45 @@
+#include "TFT_4DGL.h"
+
+TFT_4DGL lcd(p9,p10,p11);
+
+int main() {
+   
+    float h = 0.05;
+
+    int iter = 0;
+    int maxiter = 5000;
+
+    float x = 0.5;
+    float y = 0;
+
+    int xout = 0;
+    int yout = 0;
+
+    lcd.baudrate(600000);
+ 
+ while (1) {
+ 
+    double oldX = x;
+    double oldY = y;
+  
+    x = oldX-h*sin(oldY+tan(3*oldY));
+    y = oldY-h*sin(oldX+tan(3*oldX));
+  
+  iter++;
+  
+  if (iter == maxiter) {
+  
+    iter = 0;
+    x=0.5;
+    y=0;
+    lcd.cls();
+    
+  }
+            
+  xout = 50+(x*35);
+  yout = 120+(y*35);
+  
+    lcd.pixel(yout,xout,WHITE);
+
+}
+}
\ No newline at end of file