Welcome to %s forums

BrainModular Users Forum

Login Register

accelaration formula out of some array values?

I need help on a Patch
23fx23
Member
Posts: 2548

Unread post by 23fx23 » 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?

User avatar
senso
Site Admin
Posts: 4434
Location: France
Contact:

Unread post by senso » 17 May 2011, 10:39

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

23fx23
Member
Posts: 2548

Unread post by 23fx23 » 17 May 2011, 11:21

Cool. Thanks. I had a system working by sampling all deltas of x( or speed) then computing average of all values gave me an average speed to apply.
But gonna try with deltas substractions to get real accel. Thanks

Post Reply