I got the formula for this calculation from the math forum at Drexel University. If your are interested in the math behind this calculation then you can read their explanation here.
Here is a page showing the important sections of the code that performs this calculation.
If you are looking for a way to determine your latitude and longitude go to the find location page.
option 1: dddmmssD or ddd mm'ss" D
where ddd = 1-3 digits for degrees, mm = 2 digits for minutes, ss = 2 digits for seconds and D = N,S,E, or W. The seconds and special characters (spaces, apostrophes, quotes) are all optional in this format. This leads to quite a large number of possible valid formats.
option 2: ddd.ffffD
where ddd = 0-3 digits, ffff = 0-10 digits and D = N,S,E, or W. This format represents a decimal number of degrees. If the number of degrees is a whole number, the decimal point is optional.
option3: ddd mm.ffff'D
where ddd = 0-3 digits for degrees, mm = 2 digits for minutes, ffff = 0-10 digits for decimal portion of minutes and D = N,S,E, or W. This format represents degrees and a decimal number of minutes.
Copyright © 1997 Chris Michels. All rights reserved.
This page is for personal use only. Commerical use or
redistribution in any electronic form is prohibited.