Predicting X ( point of impact ) 2
Hi
I Have a moving Ball Object.
This is known about the Ball:
- Its starting coordinates ( X and Y )
- Its Angle ( 360 )
- Its Speed ( pixels moved in direction of Angle per Frame )
- Its Gravity ( pixels moved in Y direction per Frame )
Y coordinate 380 in the Frame is ground level.
...
I am trying to find a mathematical formula wich will predict the point of impact for my Ball.
...
What i have is this Forumula ( wich Konidias, Danjo and MuddyMole have been very nice and helped me with :) )
Ball Xpos - Ball Y distace from Ground * (cos(angle) / sin(angle)
This formula works perfectly :D but does however not account for the Gravity ( pixels moved in Y direction per Frame ).
Im not too good with complex math like this, but i do vaugely understand it:
The last bracket of the formula calculates the amount of X moved for every Y pixel moved.
This is then multiplied with the Y distance to Ground Level to find the amount of X the Ball has to move before reaching Ground Level.
Correct?
If i was to make a guess as to how the new formula has to look like to also account for Gravity ( pixels moved in Y direction per Frame ), it would be:
Ball Xpos - Ball Y distace from Ground * (cos(angle) / (sin(angle)+ Gravity)
But i am not sure this is correct at all.
...
Given the data above ( see top of thread ), how would i be able to predict the Balls point of impact along the Ground Level?