Delayed Logistic map fractal

Dependencies:   mbed

Committer:
JLS
Date:
Sun Dec 26 20:01:09 2010 +0000
Revision:
1:2e21ada3b00e
Parent:
0:c1a2bb86a79d
update

Who changed what in which revision?

UserRevisionLine numberNew contents of line
JLS 0:c1a2bb86a79d 1 #include "TFT_4DGL.h"
JLS 0:c1a2bb86a79d 2
JLS 0:c1a2bb86a79d 3 TFT_4DGL lcd(p9,p10,p11);
JLS 0:c1a2bb86a79d 4
JLS 0:c1a2bb86a79d 5 int main() {
JLS 0:c1a2bb86a79d 6
JLS 0:c1a2bb86a79d 7 float a = 2.27;
JLS 0:c1a2bb86a79d 8
JLS 0:c1a2bb86a79d 9 float x = 0.001;
JLS 0:c1a2bb86a79d 10 float y = 0.001;
JLS 0:c1a2bb86a79d 11
JLS 0:c1a2bb86a79d 12 int xout = 0;
JLS 0:c1a2bb86a79d 13 int yout = 0;
JLS 0:c1a2bb86a79d 14
JLS 0:c1a2bb86a79d 15 while (1) {
JLS 0:c1a2bb86a79d 16
JLS 0:c1a2bb86a79d 17 double oldX = x;
JLS 0:c1a2bb86a79d 18
JLS 0:c1a2bb86a79d 19 x = a*oldX*(1-y);
JLS 0:c1a2bb86a79d 20 y = oldX;
JLS 0:c1a2bb86a79d 21
JLS 0:c1a2bb86a79d 22 xout = 35+(x*250);
JLS 0:c1a2bb86a79d 23 yout = 15+(y*205);
JLS 0:c1a2bb86a79d 24
JLS 0:c1a2bb86a79d 25 lcd.pixel(yout,xout,WHITE);
JLS 0:c1a2bb86a79d 26
JLS 0:c1a2bb86a79d 27 }
JLS 0:c1a2bb86a79d 28 }