Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 682363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:35:15+00:00 2026-05-14T01:35:15+00:00

I want to move something a set distance. However in my system there is

  • 0

I want to move something a set distance. However in my system there is inertia/drag/negative accelaration. I’m using a simple calculation like this for it:

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

Applying that over a number of frames makes the movement ‘ramp up’ or decay, eg:

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

So I know the distance I want to travel and the acceleration, but not the initial velocity that will get me there. Maybe a better explanation is I want to know how hard to hit a billiard ball so that it stops on a certain point.

I’ve been looking at Equations of motion (http://en.wikipedia.org/wiki/Equations_of_motion) but can’t work out what the correct one for my problem is…

Any ideas? Thanks – I am from a design not science background.

Update: Fiirhok has a solution with a fixed acceleration value; HTML+jQuery demo:
http://pastebin.com/ekDwCYvj
Is there any way to do this with a fractional value or an easing function? The benefit of that in my experience is that fixed acceleration and frame based animation sometimes overshoots the final point and needs to be forced, creating a slight snapping glitch.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:35:15+00:00Added an answer on May 14, 2026 at 1:35 am

    This is a simple kinematics problem.

    At some time t, the velocity (v) of an object under constant acceleration is described by:

    v = v0 + at
    

    Where v0 is the initial velocity and a is the acceleration. In your case, the final velocity is zero (the object is stopped) so we can solve for t:

    t = -v0/a
    

    To find the total difference traveled, we take the integral of the velocity (the first equation) over time. I haven’t done an integral in years, but I’m pretty sure this one works out to:

    d = v0t + 1/2 * at^2
    

    We can substitute in the equation for t we developed ealier:

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

    And the solve for v0:

    v0 = sqrt(-2ad)
    

    Or, in a more programming-language format:

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

    The acceleration in this case is negative (the object is slowing down), and I’m assuming that it’s constant, otherwise this gets more complicated.

    If you want to use this inside a loop with a finite number of steps, you’ll need to be a little careful. Each iteration of the loop represents a period of time. The object will move an amount equal to the average velocity times the length of time. A sample loop with the length of time of an iteration equal to 1 would look something like this:

    position = 0;
    currentVelocity = initialVelocity;
    while( currentVelocity > 0 )
    {
        averageVelocity = currentVelocity + (acceleration / 2);
        position = position + averageVelocity;
        currentVelocity += acceleration;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want to move a table to a new filegroup. Using the accepted answer
I want to move some file to other place, using Java SE 1.6 So,
Hiya guys heres my question: im using mootools and im using this demo-> Drag.Move
I want to move an image within a circle with my touch on move.
I want to move to a new server and automate the process of moving
I want to move cells just as these two methods do: - (void)tableView:(UITableView *)tableView
I want to move to the next control when I press the Enter key
I want to move a div down a page, and I want it to
I want to move a part, i.e. one subdirectory of an existing, private mercurial
I want to move all files and folders inside a folder to another folder.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.