Quote:
Originally Posted by Invictus3593
We can use a time interval of about 100ms to calculate distance traveled with this equation: D=1/2at^2
|
You left out the second term...
D = ½at
2 + V
ot
... and that formula is valid only if "a" is constant over the time interval.
Hate to be a party pooper, but... Due to the double integration, tiny errors in "a" will rapidly accumulate so that the computed position will quickly diverge from the true position.
Trapezoidal integration will help somewhat: Given
t,
x,
v, and
a at some point in time, and
anew at some later point in time
tnew, proceed as follows:
dt = tnew - t;
vnew = v + dt*(anew+a)/2;
xnew = x + dt*(vnew+v)/2;