How to figure out what is happening with an approximation?

camX = map(m, 0, width,-200,200);
camY = map(k, 0, width,-200,200);
camZ = map(n, 0, width,-200,200);   
camera(-camY+300,0,-camY+200,-camZ,camX,0,0,-1,0);
fill (0,0,255);
box(150);
t = 0.7
if (aZ>-0.5 && aZ<0.5){Voz = 0}
else {Voz = Voz + aZ*t1;}   
S1 = 0; 
aZ = accelerationZ;
if (aZ>-0.1 && aZ<0.1){aZ = 0}
S1 = Voz*t1 + (aZ*t1*t1)/2;
if (aZ<-0.5 && aZ<0.5){S1 = 0}
k = k + S1;

This program should allow the user move to the cube and away from it. But when I, for example, move to the cube at first it approximation and then it becomes small like it was in the beginning. I though that it was so because of the acceleration, but I can not find the solution

the final program should imitate the movement. that is why I use formulas

Answers

Sign In or Register to comment.