Henon quadratic map - Mod3 color

main.cpp

Committer:
JLS
Date:
2011-01-09
Revision:
0:4608db13c46a

File content as of revision 0:4608db13c46a:

#include "TFT_4DGL.h"

TFT_4DGL lcd(p9,p10,p11);

int main() {
   
    float a = 0.425;
    float b = 0.382;

    float x = 0.1;
    float y = 0.1;

    int xout = 0;
    int yout = 0;
    int n = WHITE;
    int m = 0;
 
 while (1) {
 
    double x1 = x;
    double y1 = y;
  
    x = x1*cos(a)-(y1-pow(x1,2))*sin(b);
    y = x1*sin(a)+(y1-pow(x1,2))*cos(b);
    
    m++;
    
    if (m==150) {
    
    m = 0;
    
    n = rand();
    
    }
  
    xout = 110+(750*x);
    yout = 160+(950*y);
   
    lcd.pixel(xout,yout,n);
  
}
}