Hi,
I want to be able to determine where a projectile (a ball) will hit the ground.
So I'm trying to implement a formula I found on WikiPedia:
en.wikipedia.org/wiki/Range_of_a_projectile
It's the formula under "Solving for the range once again"
But I can't get it to work. I've made this CAPX to help as follows:
1. A ball is moved to a fixed position then its x & y velocities are set to random values that cause the ball to be launched upwards and to the right
2. after 0.2 seconds, I snapshot the ball's X & Y positions and velocities
3. I feed these into what I think the formula on Wikipedia dictates and display the result
4. When the ball lands, I show the actual distance travelled.
Problem is that 3 =/= 4 and I can't figure out why.
Pretty sure I could have figured all this out from first principles whilst at school - but that was 40 years ago!
Thanks!
drive.google.com/file/d/1PWaQTllN5PN0pDyYR67oDmwGKxzySIfi/view