# Launch Velocity for Simple 3D Projectile [duplicate]

This is a pretty easy question, but I can't quite figure out the answer. I have:

1. The initial position of a projectile.
2. The gravity vector.
3. The (stationary) target I want to hit.
4. A maximum launch speed of the projectile.

I want to calculate the initial velocity the projectile must be launched at to hit the target, assuming it follows a ballistic trajectory.

• My answer here (gamedev.stackexchange.com/questions/54732/…) provides the kinematic equations for motion under constant acceleration. This is adequate whenever your projectile never rises too far above the Earth's surface, so that gravity can be assumed constant. – Pieter Geerkens Dec 29 '14 at 22:11
• Thank you, but these are the forward equations (i.e given v_0 and g, where will it be at time t?). Further, they are in only one dimension. What I need is a re-arrangement of these equations to infer v_0 from a target and g. – mklingen Dec 29 '14 at 22:30
• Ah, I see, I just needed to do a bit of algebra and I found it! – mklingen Dec 29 '14 at 22:38

Vector3 displacement = (end - start);