Skip to main content
Inspiring
December 2, 2008
Answered

Single vector deceleration

  • December 2, 2008
  • 1 reply
  • 378 views
Hello,

I think this is one of those dead simple problems, yet I can’t seem to figure out what is going on...

I’m trying to get an object/ball to start at some speed, smoothly decelerate, and stop exactly as some specified distance.

The formula I’m using is from 1d kinematics:

V(f)^2 = V(i)^2 + 2ad

V(f) is 0, since I want it to stop moving, acceleration I have set to -1, and distance I have set to 100.

V(i) = squareRoot(-2 * a * d);

Yet when I run it, my object starts at 0px, and stops at 92.95px and I can't figure out why it never reaches whatever my distance is set as.
This topic has been closed for replies.
Correct answer clbeech
although i would run a decel formula a bit differently, I'm just wondering why you may not be able to use a tween with easing here? as in:

import mx.transitions.Tween;
import mx.transitions.easing.*;
new Tween(ballClip, '_x', Strong.easeOut, 0, 100, 1, true); //one second

1 reply

clbeech
clbeechCorrect answer
Inspiring
December 2, 2008
although i would run a decel formula a bit differently, I'm just wondering why you may not be able to use a tween with easing here? as in:

import mx.transitions.Tween;
import mx.transitions.easing.*;
new Tween(ballClip, '_x', Strong.easeOut, 0, 100, 1, true); //one second
Some1WonAuthor
Inspiring
December 2, 2008
Hm, I never thought of that and it does work for a single ‘push’ motion. I want to keep being able to ‘push’ this object along, every time another 100 (or some determined amount) pixels more. How would you do this with the tween class? Create a new tween every time?