# Given Angle, Initial Velocity, and Acceleration due to Gravity, plot parabolic trajectory for every “x”?

Given any Angle -> 0-90
Given any Initial Velocity -> 1-100
Given Acceleration due to Gravity -> 9.8
Plot every x,y coordinate (the parabolic trajectory) with cartesian coordinates and screen pixels (not time)

This should only be one equation as far as I can tell, a "y=" type equation, telling you the height in y coordinates based on the current x coordinate which is increasing by 1 as you plot across a computer screen.

I've come up with an equation that works for the angle 45, but doesn't seem to be entirely accurate for any other angle, I suspect it has something to do with the angle 45 having 1 solution and every other angle having 2 solutions (two different initial velocities land on the same spot), but I'm stumped beyond that.

Here is the inaccurate equation:
it won't let me attach images

-

Starting as Pieter Geerkens, the equations of motion in 2-D a parabolic system:

$x(t) = x_0 + v_x t = x_0 + v_0 \cos(\alpha) t$

and int the $y$ axis:

$y(t) = y_0 + v_0\sin(\alpha)t + \frac{1}{2}g t^2$

where $g \sim -9.8$ is the gravitational acceleration.

Solvinf for t in the first equation as Pieter did:

$t(x) = \frac{x - x_0}{ v_0 \cos(\alpha)}$

and then substituitint $t(x)$ in $y(t)$:

$y(x) = y(t(x)) = y_0 + v_0\sin(\alpha) \cdot \frac{x - x_0}{ v_0 \cos(\alpha)} + \frac{1}{2}g \left(\frac{x - x_0}{ v_0 \cos(\alpha)}\right)^2$

Then if your math is not good enoguh to do this algebraic manipulations you should study some of math to keep going. It's worth it.

-

First consider parametric equations for $x$ and $y$ as a function of $t$.

Now, for each $x$-value solve for $t = (x-x_0) / (v_0 \cdot \cos(\theta\,))$.

Then solve for the corresponding $y = y_0 + v_0 \cdot \sin(\theta\,) \cdot t - 4.9 \cdot t ^ 2$.

-
Thanks for replying but time is not helpful for my case which is why I'm trying to avoid using time as I can't quantify it. I can quantify x,y coordinates on a screen though. Given acceleration, initial position, angle, and initial velocity, is all of the information that should be needed to solve for every x,y coordinate on the projectiles path in a single equation, everything else is an imperfect solution – Luke Allen Apr 12 '13 at 7:20
Frankly, you are demonstrating a fundamental misunderstanding of the mathematics involved. The decision to solve the problem in parametric form is simply: BECAUSE IT IS EASIER THAT WAY. You asked for means of calculating (x,y), and the mechanism above supplies that. – Pieter Geerkens Apr 12 '13 at 7:24
Maybe, I'm not that great at math. I just thought I knew enough that there should only be one "y=" cartesian equation to solve for all x,y coordinates on the projectile trajectory given those variables without the need for the variable "time." I don't know what comes easier to you, but if you read the original post I request a single equation that doesn't use time, if this is actually impossible, then I'd be glad to edit the post and humbly apologize, but it seems more elegant and simple to solve in a single equation if it's possible, as my end goal is programming. – Luke Allen Apr 12 '13 at 7:36
Someone smarter will have to verify but I think the answer is: y=(-(1/2))(g)x^2/(v0*cos(theta))^2+(v0*sin(theta))x/(v0*cos(theta)) – Luke Allen Apr 12 '13 at 7:52
The answer I mentioned above is working perfectly, why would you think it's not quite correct? – Luke Allen Apr 12 '13 at 22:37