And to make it even faster
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?
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
Return to Thread:User talk:Dsekercioglu/MEA/And to make it even faster/reply (10).
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_1} \frac{v_{lateral}}{d_{initial} + v_{retreat} t}dt</math>
where <math>\theta</math> is the escape angle, <math>t_1</math> is the total time (from bullet fired, to bullet hit). (this formula is true even if <math>v_{lateral}</math> or <math>v_{retreat}</math> is not constant)
Note that <math>d_{initial} + v_{retreat} t</math> is bigger than (his) <math>(v_{bullet} - \overline{v_{retreat}})t_1</math> almost all of the time,
as <math>d_{initial} =
(v_{bullet} - \overline{v_{retreat}})t_1</math>.
Therefore his integral (<math>\theta = \int_0^{t_1} \frac{v_{lateral}}{(v_{bullet} - \overline{v_{retreat}})t_1}dt = \frac{v_{lateral}}{v_{bullet} - \overline{v_{retreat}}}</math>, assume <math>v_{lateral}</math> is constant) is bigger.
- Actually, I'm not sure that Traditional MEA is correct. It assumes that the bot doesn't change it's move angle until the wave hits. Because of that you can't get a MEA higher than Pi / 2 with Traditional MEA formula. When you move orbitally, lateralVelocity / (bulletSpeed + advancingVelocity) is the formula that will give you the EA so you can get a EA higher than Pi / 2.
You can't get escape angle higher than Pi/2 by the traditional formula simply because it is impossible.
If your formula can, it must be wrong.
- Found it!
- It should be sin(a) / (v / 8 - cos(a) / 2).
- I found a formula higher than Traditional MEA and this one should be correct.
Math.asin(Math.sin(angle) / (bulletSpeed / 8 - Math.cos(angle) / 2))
I don't think that this one is wrong. I only added advancing velocity to the Traditional MEA which shouldn't break anything with the calculations.
I don't need integral. I can get the average distance.
distance - (advancingVelocity * timeToHit / 2) = bulletFloatTime - advancingVelocity / 2
No you can't use average distance, as distance is used like x / distance, not x * distance.
- It is equal at infinity.
(8 / 5 + 1 + 8 / 11) / 3 = 1.109090909... (8 / 5 + 8 / 6.5 + 1 + 8 / 9.5 + 8 / 11) / 5 = 1.080029444...
- This goes closer to 1 every time I decrease the step size.