QuadrupTwo fractal map

Committer:
JLS
Date:
Thu Jan 20 21:56:52 2011 +0000
Revision:
0:134c94347c5a

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
JLS 0:134c94347c5a 1 #include "TFT_4DGL.h"
JLS 0:134c94347c5a 2
JLS 0:134c94347c5a 3 TFT_4DGL lcd(p9,p10,p11);
JLS 0:134c94347c5a 4
JLS 0:134c94347c5a 5 int main() {
JLS 0:134c94347c5a 6
JLS 0:134c94347c5a 7 int xp,yp;
JLS 0:134c94347c5a 8
JLS 0:134c94347c5a 9 int n = WHITE;
JLS 0:134c94347c5a 10 int m = 0;
JLS 0:134c94347c5a 11
JLS 0:134c94347c5a 12 float x,y;
JLS 0:134c94347c5a 13
JLS 0:134c94347c5a 14 float a = 34;
JLS 0:134c94347c5a 15 float b = 0.9;
JLS 0:134c94347c5a 16 float c = 5;
JLS 0:134c94347c5a 17
JLS 0:134c94347c5a 18 float x1 = 1;
JLS 0:134c94347c5a 19 float y1 = 0;
JLS 0:134c94347c5a 20
JLS 0:134c94347c5a 21 while(1)
JLS 0:134c94347c5a 22
JLS 0:134c94347c5a 23 {
JLS 0:134c94347c5a 24
JLS 0:134c94347c5a 25 x = y1 - (x1/x1) * sin(log(abs(b * x1 - c))) * atan(abs((pow(c * x1 - b,2))));
JLS 0:134c94347c5a 26 y = a-x1;
JLS 0:134c94347c5a 27
JLS 0:134c94347c5a 28 xp = (int)floor(3*x);
JLS 0:134c94347c5a 29 yp = (int)floor(3*y);
JLS 0:134c94347c5a 30
JLS 0:134c94347c5a 31 m++;
JLS 0:134c94347c5a 32
JLS 0:134c94347c5a 33 if (m==300) {
JLS 0:134c94347c5a 34
JLS 0:134c94347c5a 35 m = 0;
JLS 0:134c94347c5a 36
JLS 0:134c94347c5a 37 n = rand();
JLS 0:134c94347c5a 38
JLS 0:134c94347c5a 39 }
JLS 0:134c94347c5a 40
JLS 0:134c94347c5a 41 lcd.pixel(70+xp,110+yp,n);
JLS 0:134c94347c5a 42
JLS 0:134c94347c5a 43 x1 = x;
JLS 0:134c94347c5a 44 y1 = y;
JLS 0:134c94347c5a 45
JLS 0:134c94347c5a 46 }
JLS 0:134c94347c5a 47
JLS 0:134c94347c5a 48 }