# How to move an object with a starting and ending speed and time

I need to move an object from point a to point b in an exact amount of time, and also with constraint that the object must have a defined speed at point a and point b. To simplify matters, I am only considering motion on one axis.

I have tried to write an equation of motion for the path of the object by using a polynomial to represent the acceleration of the object:

x''(t) = b + ct

and then calculating the necessary values for b and c to satisfy the constraints:

x(t_0) = p_i (the initial position)

x(t_f) = p_f (the final position)

x'(t_0) = v_i (the initial speed)

x'(t_f) = v_f (the final speed)

However, the values I found made the object first travel backward for a period of time, and then forward. I would like to find a way to move the object that meets the 4 constraints listed above with the additional constraint that the object never moves backwards (that is, a monotonic equation of motion)

Does anyone have any ideas?

### Your answer

### Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.

### Follow this Question

### Related Questions

Move to object if collision is triggered 0 Answers

It is posible to use a vector2 with a math function? 0 Answers

HELP ME ! DICE MOVE in ARRAY 0 Answers

Unity DOTween DOMove moving in wrong direction 0 Answers

move one object to defined point according to another object movement to that point 0 Answers