I'm a senior in high school. This function is for my own personal 2d library that I'm using to recreate the classic DOS game of tank wars in java.
The problem lies within my rough approximation to infinity. Occasionally, when calculating results with it, the number will be close to, but not QUITE on the second line, like .000000000001,y or x,.0000000000001. I'm experimenting with rounding it off at the moment, and it seems to have fixed a few of the problems with the algorithm, and precision certainly isn't needed in this case, but it still occasionally messes up. |