id like to get some accelaration coeficient value out of ie a 16 steps array. ive learn that in school but i fail to get it back.
in fact im sampling mouse Y moves every bloc in a buffer array. i make a small array and i mod write position, to rec circular.
so when mouse realase i can ceck the last 16 positions. i dlike to 'guess' next step (for inertia) or get an acceleration coefficient
out of those values.
let"s say i move slowly in ramp up fom 0 to 0,5. the output vould be 0.57 or something like this.
or if i stay at 0 and make a very quick accel from 0 to 1 over 2 blocs, the output would be 2
any help?
accelaration formula out of some array values?
- senso
- Site Admin
- Posts: 4434
- Location: France
- Contact:
if you have the mouse positions
X(t) and X(t-1) X(T-2) , etc at time T, T-1, T-2 and so on
the speed is calculated
S(T) = (X(T)-X(T-1) )
S(T-1) = (X(T-1)-X(T-2))
the acceleration is now calculated
Acc(T) = S(T)-S(T-1)
we suppose that the time is 1 Bloc
X(t) and X(t-1) X(T-2) , etc at time T, T-1, T-2 and so on
the speed is calculated
S(T) = (X(T)-X(T-1) )
S(T-1) = (X(T-1)-X(T-2))
the acceleration is now calculated
Acc(T) = S(T)-S(T-1)
we suppose that the time is 1 Bloc
Olivier Sens
www.brainmodular.com
www.brainmodular.com
