# Given an initial position/velocity and a target, choose an acceleration to reach it

1. Sep 20, 2011

### rippy

I'm kind of embarrassed I can't figure this out on my own... It's to be used to determine the movement of objects in a game (2d space). This is quite obviously something that has been solved many times over, but I haven't had any luck searching for an answer, so I thought I'd try here!

1. The problem statement, all variables and given/known data

You're given an initial xy-coordinate, an initial velocity vector, a target xy-coordinate, and the magnitude of the acceleration vector. The goal is one of the following:

(a) Find a single acceleration vector which ensures the object reaches the point (i.e. passes through the point).
(b) Determine how to apply acceleration such that velocity is zero when the target is reached (i.e. stop on the point)

I've been primarily trying to figure out the easier (a), but I'd like to figure both out eventually.

2. Relevant equations

Formulae for acceleration, velocity an position relative to time (these seem obvious so I'll omit them, hope that's okay).

3. The attempt at a solution

For (a): The object is at the point if its x-coordinate and y-coordinate match the target's coordinates at the same time. We can look at the separate x and y equations for calculating the object's position based on acceleration, time, initial velocity and initial position; then, by solving for time, we can equate them. Since we know the magnitude of the acceleration, and $(a_x)^2 + (a_y)^2 = a$, we have two equations and two unknowns and can solve. However, you end up with two equated quadratic formulae which is a huge pain to attempt to solve.

My next thought was to just try to calculate the ratio of $(a_x)/(a_y)$, but I've had no luck with that either.

This isn't homework, so there's no need to be cryptic! It seems like somewhat of a homeworkey problem though so I thought it would be most appropriate to post here anyway. Currently my game objects are moving around at constant velocity and it is not satisfying at all.

Any help is appreciated, thanks!

2. Sep 20, 2011

### rude man

Re: Given an initial position/velocity and a target, choose an acceleration to reach

Is gravity involved? Is it a 2-D surface game? Once an object is launched, what forces are there that can slow it down? Lots of definition needed here.