And to make it even faster
The highlighted comment was edited in this revision. [diff]
double x = bulletSpeed; double a = -3.508129323E-5; double b = 2.460363294E-3; double c = -6.666318894E-2; double d = 8.545020365E-1; double e = -3.337830707; double angle = a * x * x * x * x + b * x * x * x + c * x * x + d * x + e; return Math.sin(angle) / (bulletSpeed / 8 - Math.cos(angle));
I know. But calculated numbers weren't exact and Wolfram Alpha's computation time exceeds.
Precision is up to 9 numbers. I think that it is enough.
Sorry, I didn't see that you changed the code. In my robot I did it like that but it is more understandable with Math.pow(x, y).
Wow, I had no idea that the escape angle could be 15% bigger than traditional MEA calculation at the most common bulletspeed of 1.9 . . . Seems like my list of things to do for GresSuffurd to become top-10 again, gets bigger and bigger.
Can you give the formula you used to prove that my formula is wrong?
I also agree that it's wrong. But why is it bigger than the correct one? Can you clarify that?
I understood that the problem with this is that it assumes that it's optimal to move in a fixed retreat angle (like moving in a perfect orbit), when it's actually true that the best retreat angle isn't a function only of the initial position, but it changes as you move around the wave. Is that the real issue?
I knew it's wrong because I had made the same mistake in my previous research.
It's bigger, simply because it uses some smaller distance to calculate the radians.
The correct one is:
<math>\theta = \int_0^t \frac{v_{lateral}}{d_{initial} + v_{retreat} t}dt</math>
Note that <math>d_{initial} + v_{retreat} t</math> is bigger than (his) <math>(v_{bullet} - v_{retreat})t</math> almost all of the time, as <math>d_{initial} + v_{retreat} t =
(v_{bullet} - v_{retreat})t</math>. Therefore his integral is bigger.