This is not a degree to decimal converter. This takes angles in deg,min,sec format (all integers) and adds or subtracts them.

The degree min sec format is a polynomial of the form (10^x)a + (1/60)a + (1/3600)a, if we were going to express this as decimal, where a and x are integers. This is no different from any decimal, which is in powers of 10: (10^2)a + 10b + c + (10^-1)d + (10^-2)e ...; we always simplify decimal numbers by borrowing from the next highest term if subtraction is negative, and carrying excess if addition results in a number greater than equal to the base we are working in.

The book I cited in my previous post (Trigonometry Refresher by Albert Klaf) describes the procedure on page 12. I would post the link, but I don't believe links make it through correctly. Google books has that page available.

As for online calculators -- I have found issues with them that are not consistent with what I understand to be the algebraic properties of angle addition and subtraction. Any calculator that does not reduce 60 min to 1 degree by carrying over to the next higher term, is not correct. I will consider your argument and see if I can come up with a proof of my method, or counter-example to yours, later, if the above does not persuade you.


In reply to Re^6: How to write testable command line script? by thechartist
in thread How to write testable command line script? by thechartist

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.