in reply to Re: Calculate bearing between GPS coordinates
in thread Calculate bearing between GPS coordinates

Thanks RonW!

I was a bit vague as I didn't want to be pedantic about details. What you're referring to is "magnetic declination" and I am aware of that, and understand it's not being considered here.

My main purpose for this little contraption (it's going to end up looking something like this) is for when I'm on my multi-kilometre hikes in the mountains, I turn the device on, press a button that writes to EEPROM the current lat/lon, then turn it off and throw it in my backpack.

In the extraordinary event that my land orienteering fails me with my map/compass due to exhaustion or lack of visibility because I'm in a large stand of 300' cedar trees and I get lost, I pull the unit back out, turn it back on, and press another button to "go back to the last save point". It'll then display the degrees and direction and distance I need to travel to get back to home base, which I'll use along with my compass if need be.

For these cases, if I'm only hiking say 30-40 km, declination corrections not being preset shouldn't be much of an issue. If I find that it is during trial runs, I'll calculate that into the software and go from there :)

I've already got duplicates of all the hardware I need (Arduino Trinket Pro, OLED screen, batteries (I'm going to test several), and the GPS sensor itself. I'm also adding in for convenience after the initial rig is completed and tested, micro USB charging port for the battery (so I can connect it to my portable solar rig to charge), an FTDI interface for the microproc so I can easily connect via serial for troubleshooting new code, and an SD card breakout so I'll be able to actually save my hiking paths if I ever so desire.

  • Comment on Re^2: Calculate bearing between GPS coordinates

Replies are listed 'Best First'.
Re^3: Calculate bearing between GPS coordinates
by huck (Prior) on Jun 01, 2017 at 03:40 UTC

    For these cases, if I'm only hiking say 30-40 km, declination corrections not being preset shouldn't be much of an issue. If I find that it is during trial runs, I'll calculate that into the software and go from there :)

    While i suspect that in most cases you will want to take the local deviation into account, in most cases you should also be able to get a general idea of it from your maps or just from memory.

    But in specific cases that may not be enough as local geological factors such as nearby magnetic materials can cause extra and sometimes large changes. (see https://www.ngdc.noaa.gov/geomag/EMM/img/dec_WMM_EMM.jpg via https://www.ngdc.noaa.gov/geomag/EMM/index.html. There are places in the USA where the deviation is 15 degrees.

    Being somewhat of a fan of geological tidbits i kinda remembered running into a site that had a database. While it is not what i remember https://www.ngdc.noaa.gov/geomag/emag2.html seems to have a world grid database available that you may find of interest to subset and somehow contain on your deviceEdit:wrong data, that was not declination, but still an interesting dataset.

Re^3: Calculate bearing between GPS coordinates
by karlgoethebier (Abbot) on Jun 01, 2017 at 08:29 UTC
    "...shouldn't be much of an issue"

    I'm not so sure if this really doesn't matter. In Germany the Missweisung is about 1° to 4° East but in the US and Canada up to 20°.

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    Furthermore I consider that Donald Trump must be impeached as soon as possible

Re^3: Calculate bearing between GPS coordinates
by Anonymous Monk on Jun 02, 2017 at 04:06 UTC
    This is largely academic due to the short distances involved, but... If you follow a constant compass bearing, you're not on a great circle path, you're following a rhumb line. For your Calgary-to-Toronto example, the great circle starts off at a bearing of 94 deg, but you need to adjust that along the way, so when you get to the destination, you're headed at 120.5 deg. The rhumb line is a constant 107.8 degrees the entire way. The rhumb bearing is calculated as follows:
    my $bearing = atan2($lon2 - $lon1, aths($lat2) - aths($lat1)); sub aths { # atanh(sin(x)) my ($x) = @_; my $y = sin($x); return 0.5*log((1 + $y) / (1 - $y)); }
Re^3: Calculate bearing between GPS coordinates
by morgon (Priest) on Jun 01, 2017 at 01:40 UTC
    So where are you going to hike?

    In Canada?

      I hike mostly in Canada, where I reside. I've spent a lot of time hiking in the US, but I like sticking to the north for the time being.

      Mostly, all over the Rocky, Columbia and Coastal mountains in west Alberta and BC, up to northern Alberta/BC. That's just recent (five years). Previous to that (and I plan to revisit), I've been on foot of much of Ontario up to the southern point of Hudson's Bay. I love northern Ontario. Although I've been through the eastern provinces, I especially did a lot of exploring on Cape Breton, NS. Other than being on a peak of one of the Rockies, Cape Breton Island is my favourite place not just to hike, but to be.

      Understand that most of my time is used for camping and exploring offbeat paths, and typically staying there for days at a time just to be in nature. It isn't just hiking. To me, this is and always has been a lifestyle (which I'm very rapidly heading back to). I am moving forward quickly to realize my overall life goal: off-grid and self-sustainable :)