Well here I am in a new location!
One of the first things I want to know in general (no pun intended), and as an amateur radio operator, is ‘where am I?’ Obviously I know where I am in the same manner as most people do… Address, City, State, etc… But for radio work, it’s a bit more involved.
Among many other aspects of the Amateur Radio hobby, one of my favorites is VHF CW/SSB work. That’s Morse code and Single Side Band on Very High Frequencies (VHF) to the uninitiated. By VHF CW/SSB, I am referring to such operations in the lower segments of the 6 Meter (50-54 MHz) and the 2 Meter (144-148 MHz) bands.
Note: If the above description doesn’t help clarify things, perhaps I’ll write a blog on ‘radio modes and frequencies’ at some later date. Or, you can simply Google those terms! LOL! (Seriously, Google will provide answers and I despise being redundant).
In VHF CW/SSB operations, one of the primary location identifiers exchanged during contacts with other amateurs is a ‘Grid Square’, technically referred to as the ‘Maidenhead Locator System’. To be sure, these days one can actually just go to a variety of websites where you simply click on your location and you are magically be provided with your latitude and longitude as well as your ‘grid square’.
As a programmer, hobbyist, indeed as an engineer by profession, I like to know the math behind the magic when clicking on a map or simply plugging numbers into a calculator. I am not apposed to using ‘tools’, but I’ve always been of the mindset that one should be able to perform a process manually before becoming dependent on ‘automation’, e.g. the aforementioned tools.
So I went looking for said math and found several articles written by other who clearly assumed that the reader was completely following their thought process without them providing the ‘fine details’. The frustration in the lack of those ‘fine details’ will become quite evident in part2.
It was initially quite frustrating. However, after reading multiple articles multiple times and selectively picking through the coherent sections, I finally derived the missing pieces… in a nutshell, I ‘figured it out’.
Oddly enough, once one figures out the missing details in the respective articles, it actually is easy. Indeed, this may very well be why other authors glossed over these ‘fine details’.
I hope not to do that here.
This is Part 1 of my own attempt at explaining the math of coordinate conversion…
The first thing required to get started is a latitude and longitude in decimal format. I will once again point out that the results from any of the following processes can be had with a mouse click using a variety of online mapping sites. However…
While I still can use a 7.5 minute quadrangle and a ‘jiffy stick’ (a ruler like stencil calibrated in minutes and seconds to derive latitude and longitude from USGS topographical maps), these days I usually derive my decimal latitude and longitude directly from a GPS receiver. However, it isn’t a problem if your coordinate data is in DMS (Degrees Minutes and Seconds) off a map or other reference, as conversion is easy and so I’ll start there.
Degrees Minutes and Seconds (DMS) to Decimal
Latitude: 41 Degrees 52 Minutes and 55.4016 seconds
Longitude: 87 Degrees 37 Minutes and 40.1376 seconds
Leave degrees as is, 41
Divide minutes by 60, (52/60 = 0.866666667)
Divide seconds by 3600, (55.4016/3600 = 0.015389333)
Then add 41 + 0.8866666667 + 0.015389333 = 41.882056 (Decimal Latitude)
Leave degrees as is 87
Divide your minutes by 60, (37/60 = 0.61666667)
Divide your seconds by 3600, (40.1376/3600 = 0.011149333)
Then add 87 + 0.616666667 + 0.011149333 = 87.627816 (Decimal Longitude)
To check your math, plug those values into Google Maps, be sure to put a minus (-) sign in front of the longitude if you are in the western hemisphere. If you did it correct, these example coordinates should display as the intersection of State and Madison in the heart of the Chicago Loop.
Another way to check your math is to simply run the process in reverse by respectively multiplying the resultant values derived in each step of the previous conversion process, i.e. multiply the decimal seconds by 3600 and the decimal minutes by 60.
0.015389333 * 3600 = 55.4016 (DMS Latitude Seconds)
0.866666667 * 60 = 52 (DMS Latitude Minutes)
41 (DMS Latitude Degrees)
End Result: 41 Degrees 52 Minutes 55.4016 Seconds, right where we started!
Simply repeat the process to convert the Longitude back to decimal.
All of this was ‘the easy stuff’!
BTW, I highly recommend doing all of this in a spreadsheet (paper or electronic). No, it’s not a necessity, but it does help maintain and keep track of the calculated values in each step of the process, because they will be called upon from time to time, making it easier to observe and understand what is going on and, to be able to repeat the process.
Try it with your own coordinates and see how this works!
Decimal to DMS (Degrees Minutes Seconds)
Despite most of the math behind the end process of calculating a Grid Square being performed using decimal coordinates, lets explore the relatively easy task of converting Decimal coordinates to Degrees Minutes and Second (DMS).
For this example and, to make things easier to check progress, I’ll use the same coordinates as the previous example.
Decimal Latitude: 41.882067
Decimal Longitude: 87.627816
As with the previous conversion, there is no need to do anything with the degree, other than separating it from the remaining values by stating it to be an integer, which we will henceforth refer to as ‘DD’
In this example:
DD = the integer of 41.882067
Therefore: Integer (41.882067) = 41 = ‘D’
i.e. int(41.882067) = 41
Now that we have DD and D, we can derive our minutes ‘M’
M equals the integer of (DD minus D) times 60.
Therefore: Integer ((41.882967 minus 41) times 60) = 52 = ‘M’
i.e. int((41.882967-41)*60) = 52
Finally, with M calculated, we can derive the last value, our seconds ‘S’
S equals (DD minus D minus M divided by 60) times 3600
Therefore: (41.882067 minus 41 minus 52 divided by 60) times 3600 = 55.4412 = ‘S’
i.e. (41.882067-41-52/60)*3600 = 55.4412
Our end result for latitude is 41 Degrees, 52 Minutes and 55.4412 Seconds.
Note: this result is slightly different in the seconds calculation (post decimal point). That said, once you get past a tenth of a second, it’s almost irrelevant. Unless of course your intention is to put a missile through a keyhole. Indeed, if you use just the first decimal point (i.e. 55.4) on the seconds, you still end up in the same spot as the decimal degree.
OK. so much for Decimal to DMS and DMS to Decimal. As with the first conversion, play with it, check your results and then have fun with it!
In Part 2 I will get into the heart of the matter, deriving a 6 digit Grid Square from coordinates.