Jump to content

Moon Hotspot


AirMe

Recommended Posts

  • Replies 1.4k
  • Created
  • Last Reply

Top Posters In This Topic

OK smart guy, what did I miss? Please enlighten us.

There was nothing wrong in your calculations but it was not a pure math problem.

The hotspot is {-71, 67} but instead of making it a special case the game calculates the distance and any distance greater than zero is rounded down to 99%.

In this case floating-point accuracy makes the distance non-zero even when the moon facility is exactly on the hotspot.

I calculated the error from the correct position so that the distance calculation gives exactly zero.

Link to comment
Share on other sites

The hotspot is {-71, 67} but instead of making it a special case the game calculates the distance and any distance greater than zero is rounded down to 99%.

In this case floating-point accuracy makes the distance non-zero even when the moon facility is exactly on the hotspot.

I calculated the error from the correct position so that the distance calculation gives exactly zero.

Cool, I see. Good job!

I'm still a little confused though, doesn't the exact error depend on 1) how admin typed in the formula, and 2) what precision the calculations are done in? How could you know either of those things? I tried a couple variations and I wasn't able to replicate this non-zero distance between {-71,67} and itself. Can you show what formula you are using, and how you calculated the error?

Link to comment
Share on other sites

I don't think it's that difficult... You find the integers where the percentage is 100%, then you have to ultimately test 4 numbers:

1) x+0.000000001 y+0.000000000001

2) x+0.000000001 y-0.000000000001

3) x-0.000000001 y+0.000000000001

4) x-0.000000001 y-0.000000000001

From what I understand, some computer programs calculate this way, rounding up/down long numbers like these.

Maybe you just have to use x-0.00...1 y-0.00...1

Link to comment
Share on other sites

I don't think it's that difficult... You find the integers where the percentage is 100%, then you have to ultimately test 4 numbers:

1) x+0.000000001 y+0.000000000001

2) x+0.000000001 y-0.000000000001

3) x-0.000000001 y+0.000000000001

4) x-0.000000001 y-0.000000000001

From what I understand, some computer programs calculate this way, rounding up/down long numbers like these.

Maybe you just have to use x-0.00...1 y-0.00...1

Floating points use binary fractions, so numbers which are easily expressible in decimal (for example, 0.000000000001), may be impossible to accurately represent in floating point. Using 32-bit floating point, what's actually stored for "0.000000000001" is 0.0000000000009999999960041972002500187954865396022796630859375, and for 64-bit floating point it's actually 0.000000000000999999999999999979886647629255615367252843506129522666014963760972

02301025390625. Small integers, like -71, should be perfectly representable in floating point though; you can store -71 in 32-bit floating point with perfect precision, so I don't know where the floating-point error could be creeping in.

Link to comment
Share on other sites

Both (-71.00000001, 67) and (-70.99999991, 67) give 100% and (-71, 67) gives 99%.

I don't know where the problem is exactly, but using Provost Zakharov's efficiency function in excel I get the same results. I guess that it comes from issues with floating point accuracy of the trigonometric calculations.

Link to comment
Share on other sites

There was nothing wrong in your calculations but it was not a pure math problem.

The hotspot is {-71, 67} but instead of making it a special case the game calculates the distance and any distance greater than zero is rounded down to 99%.

In this case floating-point accuracy makes the distance non-zero even when the moon facility is exactly on the hotspot.

I calculated the error from the correct position so that the distance calculation gives exactly zero.

Any chance of us ever finding out the details?

Link to comment
Share on other sites

Any chance of us ever finding out the details?
I cannot explain why, but what happens is this:

The hotspot is (-71, 67).

There is a formula to calculate distances on a sphere. When you use this formula to find the distance from (-71, 67) to (-71, 67), which is obviously 0, on a computer, you get a result which is very small, but still bigger than 0. Therefore, the efficiency you get if you use these exact coordinates is 99% when mathematically it has to be 100%.

The problem is solved if you change the coordinates a little and add or subtract a very small number to one of them. 0.0000001 worked in all my tests.

Edited by Golan 1st
Link to comment
Share on other sites

I cannot explain why, but what happens is this:

The hotspot is (-71, 67).

There is a formula to calculate distances on a sphere. When you use this formula to find the distance from (-71, 67) to (-71, 67), which is obviously 0, on a computer, you get a result which is very small, but still bigger than 0. Therefore, the efficiency you get if you use these exact coordinates is 99% when mathematically it has to be 100%.

The problem is solved if you change the coordinates a little and add or subtract a very small number to one of them. 0.0000001 worked in all my tests.

This is ridiculous. I hope the admin is reading this or is aware of the situation so it can be fixed for next month's hotspot.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...