No trig is actually involved. All the math can be found with these two equations that define the path of a projectile.
X=x0+vx*t
Y=y0+xy*t+0.5*g*t^2
Where:
X/y is the destination
X0/y0 is the start
Vx/vy is the velocity
T is the time
G is the gravity.
Anyways. You can solve that various ways. One is to just used a fixed vy and calculate vx.
Vy=-200
Vx=g*(x-x0)/(-vy+sqrt(vy*vy+2*(y-y0)*g))
Anyways, that takes care of calculating the velocities. Just apply that to the movement behavior of your choice.
If the behavior you want to use only lets you specify speed and angle of motion you can do this:
Speed = distance(0,0,vx,vy)
AngleOfMotion= angle(0,0,vx,vy)
Finally if you apply that formula and the object just disappears the you go a NaN. Why? It just means it’s impossible to hit the target with the provided vy value.