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 6047471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:21:16+00:00 2026-05-23T07:21:16+00:00

Been wrapping my head around this problem for a while and looking for solutions

  • 0

Been wrapping my head around this problem for a while and looking for solutions online to no effect.

Basically if I have a sprite for example located at (10,10) I want to move it to say (50,100) and the whole process to take 2 seconds or whatever duration I specify. What is the exact math behind this? I was using a distance based solution to determine speed but was just using a random modifier to control the process. I need something more precise to execute exactly over a set duration.

Any help on this issue would be greatly appreciated!

  • 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-23T07:21:17+00:00Added an answer on May 23, 2026 at 7:21 am

    Assuming linear interpolation (i.e. moving in a straight line from start position to end position at a constant rate):

    The vector from start to destination is destination – start, i.e. for your example (40,90).

    If you want this to happen over two seconds you need to divide it by two to get the distance travelled per second, so (20,45) per second for your example.

    To get the position at any given time, first record the start time and calculate the current time minus the start time in seconds. So if the animation started at 12:01:30.000 and it is now 12:01:31.500 then 1.5 seconds have past since the start of the animation.

    To get the current location you add the start location to the movement per second vector * the time elapsed, so in my example:

    (10,10) + (20,45) * 1.5 = (10,10) + (30, 67.5) = (40, 77.5)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a hard time wrapping my head around this and need some help
I'm having some issues wrapping my head around the concept of classloading, I've been
I am having some trouble wrapping my head around virtual proxies. I have read
Been running into this problem lately... When debugging an app in VS.Net 2005, breakpoints
Been a while since I've dealt with ASP.NET and this is the first time
My title is terrible but I'm having a hard time wrapping my head around
I'm finally wrapping my head around IoC and DI in C#, and am struggling
I'm wrapping a C++ library in PHP using SWIG and there have been some
I've been working on this issue for a couple days and have read several
I have been looking at MVVM for the last couple days and thought i

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.