New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG in PalPole #9

Closed
dpastorgalan opened this Issue Jul 17, 2016 · 6 comments

Comments

Projects
None yet
2 participants
@dpastorgalan

dpastorgalan commented Jul 17, 2016

I have detected a BUG in Palpole, for some reason it is doing some calculation wrong.

I have added a LAT/LONG of 46.5, 83
Then I have added two directions (normal and reverse): 343, 66 and 163, -66

I obtained two poles: 78.4, 8.2 and -78.4, 188.2 (as expected)

However if I add those two poles and click in obtain directions I get: 343, 66 and 197, -66!!!!! which is obviously wrong.

I have tried with other latitudes and it does not work always properly (but other times, it does). After playing a bit, I cannot tell when fails and when it does not.

By the way, it is important to improve this since I know people that it is using this tool to calculate the poles of their directions!! (in addition to me).

P.S. And as an improvement, would it be possible to get all numbers in a single table (including paleolat) that would be great for papers!

@Jollyfant

This comment has been minimized.

Show comment
Hide comment
@Jollyfant

Jollyfant Jul 18, 2016

Owner

Thanks Daniel, that is a good catch.. that is a little worrying. I have identified the issue and will fix it tonight.

It was doing a comparison between poleLong < siteLong and subtracting 360 - dec if true. This gives 197 instead of 163 as expected. The problem was that Javascript was doing the following string comparison "188" < "88" which evaluates to true because alphabetically 1 comes before 8.

Owner

Jollyfant commented Jul 18, 2016

Thanks Daniel, that is a good catch.. that is a little worrying. I have identified the issue and will fix it tonight.

It was doing a comparison between poleLong < siteLong and subtracting 360 - dec if true. This gives 197 instead of 163 as expected. The problem was that Javascript was doing the following string comparison "188" < "88" which evaluates to true because alphabetically 1 comes before 8.

@dpastorgalan

This comment has been minimized.

Show comment
Hide comment
@dpastorgalan

dpastorgalan Jul 18, 2016

Darn JS. I have already noticed that the mistake was "symmetric" (16° to 180 in both sides) but I could not figure out why and where was the mistake. Next bug, I might be already in the position to fix :P

Once is fixed tell me so I can try many poles to see if there is nothing else to worry. Cheers!

dpastorgalan commented Jul 18, 2016

Darn JS. I have already noticed that the mistake was "symmetric" (16° to 180 in both sides) but I could not figure out why and where was the mistake. Next bug, I might be already in the position to fix :P

Once is fixed tell me so I can try many poles to see if there is nothing else to worry. Cheers!

@Jollyfant

This comment has been minimized.

Show comment
Hide comment
@Jollyfant

Jollyfant Jul 18, 2016

Owner

That should be ASAP because this is kind of fundamental. Anyway, I will stop by on Friday at the Fort if you will let me inside :)

Owner

Jollyfant commented Jul 18, 2016

That should be ASAP because this is kind of fundamental. Anyway, I will stop by on Friday at the Fort if you will let me inside :)

@Jollyfant

This comment has been minimized.

Show comment
Hide comment
@Jollyfant

Jollyfant Jul 18, 2016

Owner

Ok, the problem has been patched. Do your tests and see if it's working, then I'll close this issue 👍. See you on Friday.

Owner

Jollyfant commented Jul 18, 2016

Ok, the problem has been patched. Do your tests and see if it's working, then I'll close this issue 👍. See you on Friday.

@dpastorgalan

This comment has been minimized.

Show comment
Hide comment
@dpastorgalan

dpastorgalan Jul 18, 2016

It is solved! However it is not elegant yet. In the pole calculation it gives angles (correctly) over 360. There is a missing "if angle > 360 then angle-360"

dpastorgalan commented Jul 18, 2016

It is solved! However it is not elegant yet. In the pole calculation it gives angles (correctly) over 360. There is a missing "if angle > 360 then angle-360"

@Jollyfant

This comment has been minimized.

Show comment
Hide comment
@Jollyfant

Jollyfant Jul 18, 2016

Owner

Ok, nothing mod 360 cannot solve. Closing this, thanks!

Owner

Jollyfant commented Jul 18, 2016

Ok, nothing mod 360 cannot solve. Closing this, thanks!

@Jollyfant Jollyfant closed this Jul 18, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment