Polynomial Type B - fractal map

Committer:
JLS
Date:
Sat Jan 22 19:01:46 2011 +0000
Revision:
0:25eda589d3ce

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
JLS 0:25eda589d3ce 1 #include "TFT_4DGL.h"
JLS 0:25eda589d3ce 2
JLS 0:25eda589d3ce 3 TFT_4DGL lcd(p9,p10,p11);
JLS 0:25eda589d3ce 4
JLS 0:25eda589d3ce 5 int main() {
JLS 0:25eda589d3ce 6
JLS 0:25eda589d3ce 7 int xp,yp;
JLS 0:25eda589d3ce 8
JLS 0:25eda589d3ce 9 int n = WHITE;
JLS 0:25eda589d3ce 10
JLS 0:25eda589d3ce 11 float x,y,z;
JLS 0:25eda589d3ce 12
JLS 0:25eda589d3ce 13 float a = -0.237;
JLS 0:25eda589d3ce 14 float b = 0.453;
JLS 0:25eda589d3ce 15 float c = 0.486;
JLS 0:25eda589d3ce 16 float d = 0.616;
JLS 0:25eda589d3ce 17 float e = 1.141;
JLS 0:25eda589d3ce 18 float f = 0.483;
JLS 0:25eda589d3ce 19
JLS 0:25eda589d3ce 20 float x1 = 1;
JLS 0:25eda589d3ce 21 float y1 = 1;
JLS 0:25eda589d3ce 22 float z1 = 1;
JLS 0:25eda589d3ce 23
JLS 0:25eda589d3ce 24 while(1)
JLS 0:25eda589d3ce 25
JLS 0:25eda589d3ce 26 {
JLS 0:25eda589d3ce 27
JLS 0:25eda589d3ce 28 x = a+y1-z1*(b+y1);
JLS 0:25eda589d3ce 29 y = c+z1-x1*(d+z1);
JLS 0:25eda589d3ce 30 z = e+x1-y1*(f+x1);
JLS 0:25eda589d3ce 31
JLS 0:25eda589d3ce 32 xp = (int)floor(x*80);
JLS 0:25eda589d3ce 33 yp = (int)floor(y*80);
JLS 0:25eda589d3ce 34
JLS 0:25eda589d3ce 35 lcd.pixel(110+xp,70+yp,n);
JLS 0:25eda589d3ce 36
JLS 0:25eda589d3ce 37 x1 = x;
JLS 0:25eda589d3ce 38 y1 = y;
JLS 0:25eda589d3ce 39 z1 = z;
JLS 0:25eda589d3ce 40
JLS 0:25eda589d3ce 41 }
JLS 0:25eda589d3ce 42
JLS 0:25eda589d3ce 43 }