Hopalong fractal other algo

Committer:
JLS
Date:
Tue Jan 18 19:53:09 2011 +0000
Revision:
0:05a050d94642

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
JLS 0:05a050d94642 1 #include "TFT_4DGL.h"
JLS 0:05a050d94642 2
JLS 0:05a050d94642 3 TFT_4DGL lcd(p9,p10,p11);
JLS 0:05a050d94642 4
JLS 0:05a050d94642 5 int main() {
JLS 0:05a050d94642 6
JLS 0:05a050d94642 7 double a,b,c,x,y,xa,ya;
JLS 0:05a050d94642 8
JLS 0:05a050d94642 9 int xout = 0;
JLS 0:05a050d94642 10 int yout = 0;
JLS 0:05a050d94642 11
JLS 0:05a050d94642 12 a = 0.9;
JLS 0:05a050d94642 13 b = 2;
JLS 0:05a050d94642 14 c = 3;
JLS 0:05a050d94642 15
JLS 0:05a050d94642 16 int n = WHITE;
JLS 0:05a050d94642 17 int m = 0;
JLS 0:05a050d94642 18
JLS 0:05a050d94642 19 xa = 3;
JLS 0:05a050d94642 20 ya = 3;
JLS 0:05a050d94642 21
JLS 0:05a050d94642 22
JLS 0:05a050d94642 23 while (1) {
JLS 0:05a050d94642 24
JLS 0:05a050d94642 25 x = ya-1-sqrt(abs(b*xa-1-c))*((xa-1)/(xa-1));
JLS 0:05a050d94642 26 y = a-xa-1;
JLS 0:05a050d94642 27
JLS 0:05a050d94642 28 m++;
JLS 0:05a050d94642 29
JLS 0:05a050d94642 30 if (m==500) {
JLS 0:05a050d94642 31
JLS 0:05a050d94642 32 m = 0;
JLS 0:05a050d94642 33
JLS 0:05a050d94642 34 n = rand();
JLS 0:05a050d94642 35
JLS 0:05a050d94642 36 }
JLS 0:05a050d94642 37
JLS 0:05a050d94642 38 xout = 130+(x*5);
JLS 0:05a050d94642 39 yout = 145+(y*6);
JLS 0:05a050d94642 40
JLS 0:05a050d94642 41 lcd.pixel(xout,yout,n);
JLS 0:05a050d94642 42
JLS 0:05a050d94642 43 xa = x;
JLS 0:05a050d94642 44 ya = y;
JLS 0:05a050d94642 45 }
JLS 0:05a050d94642 46 }