Calculate direction vector given start-end positions and velocity? I'm trying for a week now and I really have a hard time with this one. I'm pretty sure that this is something very simple but I can't seem to find a solution. I'm making a game where the enemy is shooting arrows to the player without including air friction. 
We already know the following values (just some random values):


*

*Enemy position [startPoint = (0,0)].

*Player position [endPoint = (20,10)].

*Gravity [g = 10] (In-game physics are using this value).

*Velocity [Vo = 25].


The question is "How to calculate the direction vector [u] using these values?".
I have already used u = 2Δ - gt² / 2Vo*t where Δ = endPoint - startPoint but it doesn't give me the correct vector which later will be multiplied with velocity.
I can see that because, by finding the angle of the vector θ = atan2(u.y, u.x) and getting back the direction vector u = (cosθ, sinθ), the vector is not the same.
After u is known, I can find the starting horizontal [Vox] and vertical [Voy] velocities and apply them to the arrow by doing:
Vox = Vo * u.x
Voy = Vo * u.y
 A: Finally after more than a week I managed to solve the problem. 
Here's the solution that a lot of people are seeking (I'm sorry for the expression of the formulas):
First we find the delta vector:
delta = endPoint - startPoint = (20, 10)
There are two angles involved, the inclination angle [θinc] and the projectile angle [θproj].
The inclination angle is:
θinc = atan2(-delta.y, delta.x) = 26.56
The projectile angle is:
θproj = atan(Vo² + √(Vo^4 - g(g·delta.x² + 2·delta.y·Vo²)) / g·delta.x) = 79.69
θproj = 90 - θproj = 10.31
We add the two angles and we have our final angle:
θ = θinc + θproj = 36,87
Now we can find the direction vector:
u = (cosθ, sinθ) = (0.8, 0.6)
And we have our horizontal and vertical velocities:
Vox = Vo * u.x = 20
Voy = Vo * u.y = 15

General statement: When you're in need of a tool (mathematical or physical) to complete a job, if the tool already exists, it's better to use it than trying to build it yourself. This way you complete the job quickly and you don't mess with other fields outside yours trying to build the tool. Imagine a doctor trying to build an oscilloscope. Some guys have spent their whole life trying to build and optimize a tool, to be ready for the rest of us to use. Don't make their time seem wasted. It's our duty to share the knowledge we have to help the ones that don't have. Contribution is everything!
