Projectile Motion Hello Stack Exchangers! 
I'm developing a video game. One feature requires an archer be able to target an enemy and shoot an arrow at it. I've looked around and found plenty of guides on how to do this with the  quadratic formula with the appropriate variables and am receiving what I believe to be the correct output, but the arrow trajectory isn't what it should be (it doesn't hit the enemy). Here is what I have (with a sample of values taken from the program).
Origin of the shot (608,-352); 
Target of the shot (1280, -705); 
x = 672; 
y = -353; 
g = -275 (this is what I'm using for gravity); 
v = 1000; (The velocity the arrow is shot at); 
setting up the variables: 
a = $.5g(x/v)^2 = -62.0928$
b = $x = 672$ 
c = $.5g(x/v)^2+y = -415.0928$
$ angle 1 = atan(\cfrac{-b + \sqrt {b^2 - 4ac}}{2a}) = 0.5817$

$ angle 2 = atan(\cfrac{-b - \sqrt {b^2 - 4ac}}{2a}) = 1.4727$
Then in order to get the individual X/Y velocities from that angle (which I believe is in radians):
For Angle 1
$v_x = v cos \theta = 835.50$ 
$v_y = v sin \theta = 549.48$
For Angle 2
$v_x = v cos \theta = 97.90$ 
$v_y = v sin \theta = 995.19$
Unfortunately, the arrow doesn't arc through the target location. The second angle (from the - part of the quadratic equation) doesn't fare any better. 
Any help out there?
 A: The position equations you use should be $y=y_o+v_yt+\frac{1}{2}gt^2$ and $x=x_o+v_xt$. Initial angle would come from $atan(\frac{y_f-y_o}{x_f-x_o})$, and you could use that to calculate your $x$ and $y$ velocities using cosine and sine like you were. From there, you would hold your $x$ velocity constant and your $y$ velocity changes as $v_y=v_{yo}+at$, but your motion equation should do this for you.
A: The basic equations for a projectile without air resistance are (assuming initial time is set to $0$):
$$y = y_0 + v_0 \sin \theta t + \frac12gt^2$$
$$x = x_0 + v_0 \cos \theta t$$
From the second one we get $t = \frac{x-x_0}{v_0 \cos \theta}$. Plug that in in the first one, do some manipulation and we get the following:
$$
\Delta y = \tan \theta \Delta x + \frac{g (\Delta x)^2}{2 v_0^2}+\frac{g (\Delta x)^2}{2 v_0^2}\tan^2 \theta
$$
What I call $\Delta x$ and $\Delta y$ are what you call $x$ and $y$, that is, the difference between target and origin of the shot. From here you can get $\theta$. It seems to me that you simply have a sign error in $c$: It should be $c = \frac{g (\Delta x)^2}{2 v_0^2} - \Delta y$, as seen from the above equation. Let me know if this works.
A: Without looking at the details of your question, I have one suggestion: be careful of applying mathematically theoretical equations to computer programming. In particular, you must be very, very, very careful of round-off errors. I have learned this the hard way. When you try to plot graphics using decimal values there is almost always a round-off error because pixels are referenced with integer coordinates.
I need to log off soon, so I will add more details here later if needed.
