Calculate the constant acceleration needed for the discrete time trajectory to intersect a given target point I have an object with an initial velocity in 2D space represented by a vector. I want to calculate a constant acceleration with a given magnitude required for the object to (potentially) change directions and pass through a given point (doesn't matter what angle it intersects the point or its speed when it does so, just that it intersects the point). I'm having a lot of trouble trying to figure out an equation or procedure to calculate this acceleration.
I'm running this in a physics engine, so the object has a position and a velocity (x speed and y speed). I am trying to find the direction of the acceleration required for the object to intersect the point. There are no other forces on the object. The velocity represents the distance the object travels in a single "step" of the engine and the acceleration represents the amount that the velocity changes in each step.
I tried to find a constant velocity by calculating the number of steps it would take for the object to reach the point on a single axis using the maximum acceleration, then normalizing the number of steps to get an acceleration in two dimensions. This is what I came up with:
total distance = distance covered by the initial velocity + distance gained by acceleration
so
$$p=vx+a*\frac{x(x+1)}{2}$$
where p = position, v = initial velocity, and x = step
I used this equation ($1+2+3+4+...=\frac{x(x+1)}{2}$) to calculate the distance gained by acceleration, since each new element can easily represent a step of the engine. I then used Wolfram Alpha to solve for x and got this:
$$x=-\frac{-\sqrt{a^2+8ap+4av+4v^2}+a+2v}{2a}$$ 
where $a\neq0$
This equation works both when the object's initial velocity is opposite from the target point and when its initial velocity is towards the point.
I had a lot of issues getting the object to precisely intersect the point and ultimately decided that this approach wasn't going to produce an accurate result. After that I came up with the idea that I could create some kind of parabolic curve based on the object's initial velocity and the target's position that would help me calculate the acceleration needed. Here's what I mean. I have no idea where I would even start for that, though.
Finally, I decided that it might be possible for me to use trigonometry to calculate the angles needed, but I don't really know where to start with that either. I don't know the distances that the object will have to travel on a single axis to intersect the point, since the distance changes based on the distance of the other axis (ie if the object travels faster on the x axis, it will travel slower on the y axis, and vice versa).
What is the best way to approach this problem?
 A: Your formula for distance traveled under acceleration works if the acceleration is added to the velocity at the beginning of each time step. If the acceleration is added at the end of each step, you should change $n(n+1)$ to $n(n-1).$ But if your physics engine is cleverly implemented, it might “split the difference” in effect, in which case the correct formula would have $n^2$ instead of $n(n+1).$
Any of these possible implementations is roughly the same difficulty to solve. Consider two vectors, one representing the object’s total travel after $n$ steps assuming no acceleration, and the other representing the total travel under your chosen acceleration assuming no initial velocity. The object’s actual travel is the sum of these vectors. You want that sum to equal the vector from the object’s initial position to the target. 
Let $\theta$ be the angle between the initial velocity and the initial direction to the target. The vector sum forms a triangle with sides $d$ (the initial distance to the target), $vn$ (in the initial direction of travel), and $\frac a2 n(n+1)$ opposite the angle $\theta.$
Use the Law of Cosines:
$$
\left(\frac a2 n(n+1)\right)^2 = v^2 n^2 + d^2 + 2dvn \cos\theta. 
$$
This comes out to a fourth-degree polynomial in $n,$ which has an “exact” solution in principle but is usually solved by numeric methods (basically various more or less sophisticated forms of “guess and check”).
But if you will settle for a solution that is not necessarily optimal, you can solve the following equation instead:
\begin{align}
\left(\frac a2 n(n+1)\right)^2 &= v^2 n^2 + d^2 + 2dvn \\
&= (vn + d)^2.
\end{align}
This is easily solved by taking the square root of both sides (knowing they both must be positive) and then solving a quadratic equation. 
Since $2dvn \geq 2dvn \cos \theta,$
the simplified equation will give you a number of timesteps $n$ that is certainly sufficient, and possibly more than you want at maximum acceleration. 
In the latter case (that is, whenever $\theta\neq0$), after solving the simplified equation for $n,$ plug that value of $n$ into the original equation and replace $a$ by a factor that makes both sides equal. 
Finally, use that factor as your acceleration. 
You can find the correct direction of acceleration by recomputing the vector sum and finding the direction of the vector representing acceleration. 
