omaremad wrote:i dont really understand what you mean, but you want to make one function that gives the result?
alpha = asin or acos or atan of f(yf,yi,xf,xi,g)
You already have it... i dont get what you mean.
The sin / cos equations i think you are talking about resolve the velocity into its vertical and horizontal components, since you already have these 2 velcoities im guessing you want the final velocity(the opposite)?
you can do that via pythagoras(and my ascii triangle) or add verticalVel*sin(alpha)+horizontalVel*cos(alpha)
What I have:
-intial velocity (not in x or y) just the initail one (only the scalar value).
-gravity
-y initial, x initial y final, x final.
Using this equations:
xf = xi + |vox|*t
and
yf = yi + |voy|*t + (g*t^2)/2.
the only parameter that I don't have and want is the alpha value with which I botain |vox| and |voy|.
I make it more clear: (I know I should do it earlier).
xf = xi + |vox|*t
xf = xi + |vo|*cos(alpha)*t;
yf = yi + |voy|*t + (g*t^2)/2
yf = yi + |vo|*sin(alpha)*t + ((g*t^2)/2
so:
Replacing time from first equation we have:
yf = yi + |vo|* sin(alpha)*((Xf-xi)/(|vo|*cos(alpah)) + (g*((Xf-xi)/(|vo|*cos(alpah))^2 )/2
In this las one equation we have that the only incongit is alpha cause I have the rest of paramters, so the only thing to do is conitnue resolving it.
Here is my problem, cause you must apply some trigonometric equivlente to finaly have either atan, acos or asin, whatever , it doen matter.
Take this last one and try to resolve it. You will find with what I mean.
[EDIT] and you are right I miss some parameter:
alpha = asin or acos or atan of f(yf,yi,xf,xi,g,
|vo|)