I would try setting this up as simultaneous equations for t and speed. Take your equation “speed*dir = (pf-pi-.5at\^2)/t” and split it into x and y components; that will give you two equations in two unknowns, which should be soluble. (I’m assuming this is in 2D. If in 3D, dir and pf - pi must be in the same plane, so you could transform into coordinates where this plane is the xy plane, or similar.)

I need to figure out some way to give a projectile an initial speed in order to reach point pf, starting from point pi, with a velocity in the direction of dir.

The equation for motion is:

pf = pi + vt + .5at\^2

I can solve for v:

v = (pf-pi-.5at\^2)/t

I can even solve for the speed

speed*dir = (pf-pi-.5at\^2)/t

speed = (pf-pi-.5at\^2)/(t*dir)

but the problem is that the new equation expects a time input. Time should not matter in this equation, as I can not know from beforehand how much time the trajectory will take.

How should I solve this? and what does it mean to divide a vector by a vector (as given by the new equation)?

thanks