Welcome to the NavList Message Boards.

NavList:

A Community Devoted to the Preservation and Practice of Celestial Navigation and Other Methods of Traditional Wayfinding

Compose Your Message

Message:αβγ
Message:abc
Add Images & Files
    or...
       
    Reply
    Re: Measurements
    From: Brad Morris
    Date: 2017 Jul 26, 21:38 -0400
    Hi Tony

    Let us first consider the positive value case.  I will pick a random decimal value of 12.34567°

    If we take the integer value of that, we obtain 12°, with a remainder of 0.33567°.  So now we know D, of DMS.

    To determine M, take the integer value of ((12.34567 - 12.00000) * 60).  So we have integer((0.34567)*60) = integer (20.7402) = 20 minutes, with a remainder of 0.7402 minutes.  So M=20.  

    To determine S is a bit trickier.  Let's assume you want the value rounded to the nearest second.  Find the round ((12.34567 - 12.00000 - 20/60)*3600).  That is from the original value of 12.34567°, subtract the whole number of degrees and subtract the whole number of minutes, converted to degrees by dividing that by 60.  This will yield the number of seconds, in units of degrees, so multiplying by 3600 converts that intermediate result to units of decimal seconds.  To resume the example, we have round ((0.0123366)*3600) = round (44.412) = 44 seconds.  It rounded down, therefore S=44

    Thus we have 
    12.34567° = 12°20'44"
    That's decimal degrees to DMS for the positive case.

    That's more than enough head start on the negative case.  It works in a similar fashion, but be careful.  Take the integer value of -54.321°.  Do you get -55° or -54°? We want -54.  Be careful when determining the remainder, as we want -.321.  Make sure your signs are appropriate.

    +++++++

    I converted all the way to rounded seconds.  Suppose you wanted a CN result.  That would be degrees and decimal minutes, rounded to the nearest tenth of a minute.  That is,  D.M.m.


    The first step is the same, integer(12.34567°) = 12.°  

    The second step is a bit different.  Take the remainder of 0.34567 and multiply by 600.  That is, there are 600 tenths of a minute per degree.  0.34567*600=207.402 tenths of a minute.  Find the round(207.402) and we get 207.  Now divide by 10, obtaining 20.7 decimal minutes.

    Therefore
    12.34567° =12°20'.7

    Again, I will leave the exercise to you Tony, to evaluate the negative case.  It's no fun if I just tell you the answer, you should have to work at it a bit.  May I suggest you try to write this in MS Excel spreadsheet?  



    Brad















    I

    I

    On Jul 26, 2017 12:45 PM, "Tony Oz" <NoReply_TonyOz@fer3.com> wrote:

    Dear Brad, you said:

    The modest fun begins when converting from decimal degrees back to D.M.S., insuring the proper use of truncation, floor, integer and rounding functions such that the result is proper for both positive and negative angles. Modest fun is the appropriate phrase! It's just tricky enough to require some thought, yet not so difficult as to require deep thought.

    I'd be glad to learn more about exactly that - the decimal-to-DMS convertion. I'm having some difficulties at guessing the proper start of the procedure.

    Thank you in advance.

    Warm regards,

    Tony

    View and reply to this message

       
    Reply
    Browse Files

    Drop Files

    NavList

    What is NavList?

    Join NavList

    Name:
    (please, no nicknames or handles)
    Email:
    Do you want to receive all group messages by email?
    Yes No

    You can also join by posting. Your first on-topic post automatically makes you a member.

    Posting Code

    Enter the email address associated with your NavList messages. Your posting code will be emailed to you immediately.
    Email:

    Email Settings

    Posting Code:

    Custom Index

    Subject:
    Author:
    Start date: (yyyymm dd)
    End date: (yyyymm dd)

    Visit this site
    Visit this site
    Visit this site
    Visit this site
    Visit this site
    Visit this site