Where The *** Am I? (Part 2b)

I’m back with the final installment of ‘Where The *** Am I?’, Calculating a Grid Square.

I’m assuming that you’ve read and understand the information in Part 1 and Part 2b.

For this example, I’ll continue to use the same coordinates as in the previous segments.

Latitude:      41.8820670
Longitude: -87.6278160

As with the previous examples in parts 1 and 2b, these coordinates should come back to the intersection of State and Madison in the heart of Chicago’s Loop.

There are six digits in a typical Grid Square location.  To be accurate, typical Grid Squares can be four or six digits in length.  Actually, a “grid square” can be comprised of the first two digits alone, but you might as well say somewhere really big on planet earth.  At best, here in ‘the vicinity’ of the United States, a two digit grid square might narrow your location down to somewhere in North America.

The grid resolution you choose to use depends on how detailed you wish to be regarding your location.  It is possible to actually drill down as deep as an 8 digit Grid Square,  even 10 theoretically.  That, however, is overkill for the vast majority of Amateur Radio operations.

Getting Started

The First Digit.

For our first digit, we simply take our Decimal Longitude and add 180 to it, then divided by 20.  If one is in the western hemisphere, longitude will be a negative number (i.e. preceded with a minus (-) sign.

-87.627816 plus 180 equals 92.32184               ( -87.627816 + 180 = 92.32184 )

Now, divide the result, 92.32184 by 20:

92.32184 divided by 20 equals 4.6186092    ( 92.3218400/20 = 4.6186092 )

The number to the left of the decimal point, 4, is the integer value of 4.6186092 derived in the previous step.  That integer, 4, is a place-holder value for our first Grid Square digit.  More on that in a bit.

OK great, but we’re not done yet! We need to derive another value  to be used later when we calculate our third Grid Square digit.

To obtain that value we must perform Modulo Division on 4.6186092, the value we obtained in the previous step.  Remember, however, the goal is to do this calculation manually.

So, to perform modulo division manually, we start by dropping the number to the left of the decimal point, 4, which we’ve already identified as the integer of 4.6186092.  This leaves us with 0.6186092, the leftover digits after the initial divide by 20 in the previous step.

Since we are not using a scientific calculator or spreadsheet with a Modulo function in this exercise we, again, do it manually.

Multiply 0.6186092, by the same divisor used to obtain  4.6186092.  We had divided 92.32184 by 20, so now we’ll multiply 0.6186092 by that same divisor, 20.

0.6186092 times 20 equals 12.327184      ( 0.6186092 * 20 = 12.327184 )

File that number, 12.327184, away for use later on in the process.

The Second Digit.

This process is identical to the first, except that we will be using our Decimal Latitude, adding 90 to that value, and then dividing that number by 10.

41.882067 plus 90 equals 131.882067                 ( 41.882067 + 90 = 131.882067 )

Now divide that result,  131.882067, by 10:

131.882067 divided by 10 equals 13.1882067     ( 131.882067/10 = 13.1882067 )

As with the first digit, the number to the left of the decimal point, 13, is the place-holder value for our Second Grid Square digit.

As with the first digit calculation, we’re not done yet, We again need another value to be used later to calculating our fourth Grid Square digit.

Just as we did in the first digit calculation, we must perform Modulo Division on 13.1882067, the value we obtained in the previous step.

So, we start by dropping the number to the left of the decimal point, 13, which we’ve already identified as the integer of 13.1882067.  This leaves us with 0.1882067, the leftover digits after the initial divide by 10 in the previous step.

We now multiply 0.1882067 by the same divisor used to obtain 13.1882067.  We divided 131.8820670 by 10, so now we’ll multiply 0.1882067 by that same divisor, 10.

0.1882067 times 10 equals 1.882067      ( 0.1882067 * 10 = 1.882067 )

File that number, 1.882067, away for use later on in the process.

The Third Digit.

This is where we start to use the secondary results derived during the calculations for the first two digits to obtain our third and fourth Grid Square digits

Start by taking the results of the Modulo Division (which we did manually) derived while calculating our first digit, 12.327184. In this process, we will start by dividing this value by 2.

12.327184 divided by 2 equals 6.186092          (  12.327184 /2 = 6.186092 )

As in previous calculations, we need the integer of 6.186092, which is the same as simply taking the number to the left of the decimal point, 6.  Not a place-holder, this is the actual value for third Grid Square digit.

However, as with the preceding processes, we’re not done yet. We again have to do some Modulo Division to later obtain, in this case, the fifth digit of our Grid Square.

Take the digits to the right of the decimal point, 0.186092, we use Modulo Division by multiplying this value by the original divisor in this section, 2.  This gives us a value to save for use later, 0.372184, as we calculate our fifth Grid Square Digit.

The Forth Digit.

Start by taking the results of the Modulo Division (which we did manually) derived while calculating our second Grid Square Digit, 1.882067.

In this process, there is really no need to go through the process of division, because anything divided by one is the same number. We do require the integer of 1.882067, which is, 1.  As with the third digit, it’s not a place-holder, this is the actual value for our Forth Grid Square digit, 1.

However, as with the preceding processes, we’re not done yet. We again have to do some Modulo Division to later obtain, in this case, the sixth digit of our Grid Square.

Take the digits to the right of the decimal point, 0.186092, we use Modulo Division by multiplying this value by the original divisor in this section, 1.  This gives us our value to save for later, 0.372184.

Now before we continue, it is important to note that we have all but completed 4 digit grid square which is a common/general locator.  To complete that, we need to map our place-holder values to alpha characters.  We do this by correlating the numerical values to letters of the alphabet or, as I jokingly refer to it, our ‘Little Orphan Annie Secret Decoder Ring’. Don’t worry if you don’t get the reference…

0 (zero) correlates to the letter “A”, 1 (one) to the letter “B”, 3 (three) to the letter “C”, and so on until we end up at 25 (twenty-five), which correlates to the letter “Z”

With that in mind, we convert digits one and two, 4 and 13, which become E and N.  Remember that digits three and four, 6 and 1, were not ‘place-holder’, but the actual digit.

Putting all four together in order, we get a Grid Square of EN61

This four digit grid square represents a geographical area of 20 degrees of longitude by 10 degrees of latitude. This particular grid, EN61, is depicted in the image below, taken from the website QTH Locator.

EN61

As can be seen in the image, this is a fairly large geographical area but is, nonetheless, a common reference in amateur radio communications.  When you are talking about HF  (High Frequency), a.k.a. ‘short wave’ propagation, this is enough in most cases to see how far your signal is traveling or, how far away another station is from your location.

We can, however, do better.  A four digit grid square can be further divided into twenty-four, 5 minute (0.083333 degrees) of longitude and Ten, 15 second (0.00416665 degrees) of latitude.

The  Fifth Digit.

Start by using the result of the Modulo Division (which we did manually) while calculating our Third Grid Square Digit, 0.372184.

We divide this value by 0.08333, representing five minutes of longitude.

0.372184 divided by 0.083333 equals 4.66225865
( 0.372184/0.083333 = 4.66225865 )

Taking the integer of 4.66225865, gives us, 4, which is  a ‘place-holder’ value for our fourth grid square digit.  If we run that past our previously discussed “decoder ring”, we get the letter, E.

Note: It is simply a coincidence of this example, that our first and forth grid square digits are the same.

The Sixth Digit.

Here we do the same as we did with the fifth digit, taking the result of our modulo division, except in this case, from the Forth Grid Square Digit calculations, 0.882067.

We divide this value by 0.0416665, representing 15 degrees of latitude.

0.882067 divided by 0.0416665 equals 21.16969268
( 0.882067/0.0416665 = 21.16869268 )

Taking the integer of 21.16969268, gives us, 21, which is  a ‘place-holder’ value for our forth grid square digit.  If we run that past our previously discussed “decoder ring”, we get the letter, V.

Putting it all together, we now have a 6 digit Grid Square: EN61EV.

Once again using the website QTHLocator, it can be easily seen that the new grid square covers a geographical area that is substantially smaller.

EN61EV

Generally speaking, a 6 digit Grid Square is about as tight of resolution as anyone typically goes.

That said, in researching this topic deeper, I discovered a paper written by Les Peters, N1SV, on calculating a forth pair, further reducing down the geographical area under the Maidenhead system.

Les explains the fourth pair this way:

‘Each field can be further subdivided into (10) 30 seconds (0.008333 degrees) longitudinal by (10) 15 seconds (0.004166) latitudinal zones. The first character encodes the longitude and the second encodes the latitude with numbers “0” through “9”.’

Source: Les Peters, N1SF…How to calculate your 8-digit grid square

The Seventh Digit.

To begin, we have to return to the fifth digit calculations. We need to process the leftover part of 4.466225865, the integer of which, 4, was our fifth digit.  Specifically, we need to process that number 0.466225865 by multiplying it by 0.008333, the original divisor from that same ste, (modulo division) gives us 0.38852

0.038852 divided by 0.008333 equals 4.662426497
( 0.038852/0.008333 = 4.662426497 )

Taking the integer of 4.662426497, we obtain our seventh Grid Square Digit, 4.

The Eighth Digit.

The process used in the seventh digit is repeated except that our leftover via modulo division is 0.007075, taken from the sixth digit calculations, and our divisor is 0.004166.

0.007075 divided by 0.004166 equals 1.697191551
( 0.007075/0.004166 = 1.697191551 )

Taking the integer of 1.697191551, we obtain our eighth Grid Square Digit, 1.

Putting it all together now results in an eight digit grid square of. EN61EV41.

To see the results of these extra digits, we must use a different mapping web site,  k7fry.com.

Plugging in the eight digit grid square, we can see the results in the following image.

EN61EV41

As can be seen, the total geographical area is once again reduced.  This time to a few square blocks.  Looking closely at the image, we can see that our original coordinates, which resolve to the intersection on State and Madison, located in Chicago’s ‘Loop’, are in fact located within this grid square.

Beyond the scope of this posting…

Astounding to me, I discovered through the use of the K7FRY website, a ten digit grid square is possible.   Unfortunately, I have been unable to find any clear documentation on the process,  other than it might be another iteration such as that used in calculating the seventh and eight digits.

However, the K7FRY website also featured a click on a location, and so it was possible to learn ones ninth and tenth grid square digits.  The results were interesting as can be seen in the following image.

EN61EVPG

The geographical area has gone from several square blocks, to perhaps something less than a couple of hundred square feet.  This would, in many cases, permit one person to actually see another, even in a crowded urban setting such as the Chicago Loop.

To be sure, I don’t know anyone who uses an eight, let alone a ten, digit grid square.  It is, nonetheless, interesting to know it is possible and, how to obtain them with a little basic math. Well, eight digits at least.

That’s it! If I have screwed up somewhere with the math, please let me know.

Until next topic…

 

 

 

Advertisements

Where The *** Am I? (Part 1)

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).

Moving On…

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

Example Location:
Latitude: 41 Degrees 52 Minutes and 55.4016 seconds
Longitude: 87 Degrees 37 Minutes and 40.1376 seconds

Latitude:

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)

Longitude:

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.