there have been other topics for that. The equations for the motion of a falling projectile is this:
X0,y0 is the start position
X1,y1 is the end position
Vx,Vy is the velocity
t is time
If you pick a time and then solve those equations for vx and vy that would do it.
I think it's referred to elsewhere as predictive aiming. You could also Google kinematics for more tutorials about the equations used.