Tinkerbell fractal

Committer:
JLS
Date:
Sun Dec 26 19:53:45 2010 +0000
Revision:
1:1ea2331f9cbe
Parent:
0:db833ae9852c
update

Who changed what in which revision?

UserRevisionLine numberNew contents of line
JLS 0:db833ae9852c 1 #include "TFT_4DGL.h"
JLS 0:db833ae9852c 2
JLS 0:db833ae9852c 3 TFT_4DGL lcd(p9,p10,p11);
JLS 0:db833ae9852c 4
JLS 0:db833ae9852c 5 int main() {
JLS 0:db833ae9852c 6
JLS 0:db833ae9852c 7 float a = 0.9;
JLS 0:db833ae9852c 8 float b = -0.6013;
JLS 0:db833ae9852c 9 float c = 2;
JLS 0:db833ae9852c 10 float d = 0.5;
JLS 0:db833ae9852c 11
JLS 0:db833ae9852c 12 float x = -0.72;
JLS 0:db833ae9852c 13 float y = -0.64;
JLS 0:db833ae9852c 14
JLS 0:db833ae9852c 15 int xout = 0;
JLS 0:db833ae9852c 16 int yout = 0;
JLS 0:db833ae9852c 17
JLS 0:db833ae9852c 18 while (1) {
JLS 0:db833ae9852c 19
JLS 0:db833ae9852c 20 double oldX = x;
JLS 0:db833ae9852c 21
JLS 0:db833ae9852c 22 x = pow(x,2)-pow(y,2)+a*x+b*y;
JLS 0:db833ae9852c 23 y = 2*oldX*y+c*oldX+d*y;
JLS 0:db833ae9852c 24
JLS 0:db833ae9852c 25 xout = 210+(x*135);
JLS 0:db833ae9852c 26 yout = 170+(y*105);
JLS 0:db833ae9852c 27
JLS 0:db833ae9852c 28 lcd.pixel(yout,xout,WHITE);
JLS 0:db833ae9852c 29
JLS 0:db833ae9852c 30 }
JLS 0:db833ae9852c 31 }