[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #65291] [octave forge] (mapping) degrees2dms p
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #65291] [octave forge] (mapping) degrees2dms produces incorrect results |
Date: |
Fri, 8 Mar 2024 15:05:50 -0500 (EST) |
Follow-up Comment #11, bug #65291 (group octave):
Somehow I didn't realize the Octave mapping package had angl2str. Thanks for
pointing that out.
> > Does the `elseif (ischar (deg))` branch prevent some incorrect result, or
was it just added for clarity or to save unnecessary computation?
> Again, degrees2dms.m is not my code.
Based on your comment #2 I thought you added that part. Maybe I didn't
understand what you meant.
> Then, you mention a d2dms function you wrote. Would you like to swap the
current mapping function's code with your code? Or amend it with your code?
> I'm all open to suggestions.
I am offering to modify the current degrees2dms function to resolve the
off-by-one-minute issue, improve tests, and correct some issues in the
documentation. To calculate the magnitudes of the degrees-minutes-seconds
components, I propose to use one of the following two methods:
* The method used in the d2dms function I provided in comment #6.
* Accuracy is reasonable. Recomputing degrees from the output as
`s/3600 +
m/60 + d` seems to be within 1 ulp or so of the original input.
* It is quite simple.
* Hopefully it is reasonably easy to become convinced that it has no
major
issues.
* Performance is good.
* Based on comment #7 it seems to MATLAB-compatible for single. I would
guess it is for double as well.
* A more accurate method I developed.
* Output angle is as near as possible to the input angle.
* It is roughly four times more complicated.
* It was not very easy to convince myself that it's correct. I still
wouldn't put my confidence over 99%.
* Performance on my machine is roughly two times worse.
* Due to the better accuracy, it is not MATLAB-compatible.
I am seeking input as to which approach would be preferred.
As for the handling of negative inputs, I am hopping someone will be able to
provide MATLAB output for the test in comment #9.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?65291>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- Message not available
- [Octave-bug-tracker] [bug #65291] [octave forge] (mapping) degrees2dms produces incorrect results,
anonymous <=
Message not available
Message not available
Message not available
Message not available
Message not available
Message not available
Message not available