Posted: 12 May 2011, 04:23
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?
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?