Kamil Ondrousek / Mbed 2 deprecated Quadratic

Dependencies:   mbed

Committer:
JLS
Date:
Mon Jan 03 21:35:33 2011 +0000
Revision:
0:c2992d2f3c66

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
JLS 0:c2992d2f3c66 1 #include "TFT_4DGL.h"
JLS 0:c2992d2f3c66 2
JLS 0:c2992d2f3c66 3 TFT_4DGL lcd(p9,p10,p11);
JLS 0:c2992d2f3c66 4
JLS 0:c2992d2f3c66 5 int main() {
JLS 0:c2992d2f3c66 6
JLS 0:c2992d2f3c66 7 double x1,y1,z1,x,y,z,dt;
JLS 0:c2992d2f3c66 8 int xp,yp;
JLS 0:c2992d2f3c66 9
JLS 0:c2992d2f3c66 10 float a = 2.017;
JLS 0:c2992d2f3c66 11
JLS 0:c2992d2f3c66 12 x1 = -0.9;
JLS 0:c2992d2f3c66 13 y1 = 0;
JLS 0:c2992d2f3c66 14 z1 = 0.5;
JLS 0:c2992d2f3c66 15
JLS 0:c2992d2f3c66 16 dt = 0.01;
JLS 0:c2992d2f3c66 17
JLS 0:c2992d2f3c66 18 while(1)
JLS 0:c2992d2f3c66 19
JLS 0:c2992d2f3c66 20 {
JLS 0:c2992d2f3c66 21
JLS 0:c2992d2f3c66 22 x = x1+(y1)*dt;
JLS 0:c2992d2f3c66 23 y = y1+(z1)*dt;
JLS 0:c2992d2f3c66 24 z = z1+(-a*z1+pow(y1,2)-x1)*dt;
JLS 0:c2992d2f3c66 25
JLS 0:c2992d2f3c66 26 xp = 55+(int)floor(34*x);
JLS 0:c2992d2f3c66 27 yp = 135+(int)floor(39*y);
JLS 0:c2992d2f3c66 28
JLS 0:c2992d2f3c66 29 lcd.pixel(yp,xp,WHITE);
JLS 0:c2992d2f3c66 30
JLS 0:c2992d2f3c66 31 x1 = x;
JLS 0:c2992d2f3c66 32 y1 = y;
JLS 0:c2992d2f3c66 33 z1 = z;
JLS 0:c2992d2f3c66 34
JLS 0:c2992d2f3c66 35 }
JLS 0:c2992d2f3c66 36
JLS 0:c2992d2f3c66 37 }