Calculate the initial speed for moving a given distance with inertia

I want to move something a certain distance. However, there is inertia / resistance / negative acceleration in my system. I use a simple calculation for this:

v = oldV + ((targetV - oldV) * inertia)

Applying this to several frames, the movement "grows" or splits, for example:

v = 10 + ((0 - 10) * 0.25) = 7.5 // velocity changes from 10 to 7.5 this frame

So, I know the distance that I want to travel, and the acceleration, but not the initial speed, which will force me there. Perhaps the best explanation I want to know is how difficult it is to get into a billiard ball so that it stops at a certain point.

I look at the equations of motion ( http://en.wikipedia.org/wiki/Equations_of_motion ), but cannot decide which one is right for my problem ...

Any ideas? Thank. I am from design, not from science.

: Fiirhok ; - HTML + jQuery:
http://pastebin.com/ekDwCYvj
? , , , , .

+5
3

.

t (v) :

v = v0 + at

v0 - , a - . ( ), t:

t = -v0/a

, ( ) . , , :

d = v0t + 1/2 * at^2

t ealier:

d = v0^2/a + 1/2 * v0^2 / a

v0:

v0 = sqrt(-2ad)

, :

initialVelocity = sqrt( -2 * acceleration * distance );

( ), , , .

, . . , , . , 1, :

position = 0;
currentVelocity = initialVelocity;
while( currentVelocity > 0 )
{
    averageVelocity = currentVelocity + (acceleration / 2);
    position = position + averageVelocity;
    currentVelocity += acceleration;
}
+7

, :

alt text

+3

, - . [v, 0], v ( ).

+1

All Articles