- #1
CaspianTiger
- 17
- 0
Hi,
I am trying to use the shooting method to determine the angle of a projectile. However for some values of distance and initial velocity my value for angles get stuck between two values.
I want to put a piece of code into my shooting method which can either detect that my while loop has become stuck between two values or after a certain number of values offers an error message suggesting a different initial velocity for that distance.
I was thinking of using a try catch statement however i am not sure how these work and i am not sure how to state i want my error message to occur after a certain value of iterations of my while loop.
If you want my present code i can post it.
Any help would be great.
Thanks
I am trying to use the shooting method to determine the angle of a projectile. However for some values of distance and initial velocity my value for angles get stuck between two values.
I want to put a piece of code into my shooting method which can either detect that my while loop has become stuck between two values or after a certain number of values offers an error message suggesting a different initial velocity for that distance.
I was thinking of using a try catch statement however i am not sure how these work and i am not sure how to state i want my error message to occur after a certain value of iterations of my while loop.
If you want my present code i can post it.
Any help would be great.
Thanks