QuadrupTwo fractal map

main.cpp

Committer:
JLS
Date:
2011-01-20
Revision:
0:134c94347c5a

File content as of revision 0:134c94347c5a:

#include "TFT_4DGL.h"

TFT_4DGL lcd(p9,p10,p11);

int main() {

     int   xp,yp;
     
     int n = WHITE;
     int m = 0;
   
     float x,y;

     float a = 34;
     float b = 0.9;
     float c = 5;
  
     float x1 = 1;
     float y1 = 0;

    while(1)
    
    {
    
        x = y1 - (x1/x1) * sin(log(abs(b * x1 - c))) * atan(abs((pow(c * x1 - b,2))));
        y = a-x1;

        xp = (int)floor(3*x);
        yp = (int)floor(3*y);
        
        m++;
    
        if (m==300) {
    
        m = 0;
    
        n = rand();
    
        }

        lcd.pixel(70+xp,110+yp,n);
      
        x1 = x;
        y1 = y;

    }
 
}