elyob said:
"Ian Smith" <[email hidden]> wrote in message
news:[email hidden]...
Quoted message said:
Very few of them actually know bearing (there are a few with compass
built in, but it's generally a very poor compass). It only knows
bearing because it knows where the last point is and where this point
is, so you can always work out the bearing from the tracklog as well
as the unit could (and indeed did in the first place).
I figured that out after I posted. If you know where you were before, then
you can work out the direction when you hit your new point. I liked the
Carol part of Countdown, and my maths is okay. But not rocket science maths.
How can I work out the angle between these?
#1 ( -0.2952833333333333 51.385083333333334 )
#2 ( -0.2843333333333333 51.38218333333333 )
or
#1 ("N5123.1050' W00017.7170' "😉
#2 ("N5122.9310' W00017.0600' "😉
OK, whistle-stop tour. Bear in mind this is my understanding as
'interested amateur' rather than actual professional expert. The
difficult part is going from GPS lat-long (which is based on WGS84
datum) to a flat paper map grid (which, if OS, is based on OSGB36
datum).
It can't be done precisely, but there are about 3 levels of 'close
enough' that can be done.
It can't be done precisely because the grid system you're wanting the
bearing in does not consistently mathematically map onto any lat-long
system, because of the way it is defined. This is the consequence of
historical differences in surveys.
You can pay the OS lots of cash and get a very complicated transform
that will give you millimetre accuracy. This is called OSTN97 and
something else I forget. You don't want it.
You can use a 6-parameter iterative calculation that will give you
metre accuracy transformation between the lat-long spewed by the GPS
to lat-long used by OS, and can then transform that by transverse
mercator to a theoretical grid. This will give you metre accuracy.
This is what I used in my program for the Psion 5mx which you can find
at http://www.astounding.org.uk/ian/GPSion5/ . You probably don't
want this either for your application.
You can pretend the earth is a sphere, and ignore any spherical
geometry effects, thus avoiding the need for eg transverse mercator.
For simply slapping an arrow on a map, you probably want this one.
If your data is in magellan standard format '5123.1050' means 51
degrees 23.1050 minutes.
Note that 1 degree of latitude is the same length (on our spherical
earth) everywhere on the surface, so we just note that from #1 to #2
you went 22.9310-23.1050 = -0.174 minutes north.
1 degree of longitude varies in length depending on your latitude.
At latitude 'x', 1 degree longitude is cos(x) times as long as at the
equator. You travelled 17.0600-17.7170 = -0.656 minutes west, or
0.656 minutes east. But, because you did so at 51.383 degrees north
that's only as far over the ground as 0.656 x cos(51.383) = 0.656 x
0.624 = 0.409 minutes east at the equator.
One minute of latitude, or one minute of equatorial longitude, is 1
nautical mile (which is handy). So, you went -0.174 n.mile north,
and 0.409 n.mile east. By simple trig, that means a bearing of
90+asin(0.174/0.409) = 115 degrees. This will be closeish, as long as
your two points are fairly close together (less than a degree will be
fine, I think).
Note that the lat/long used by OS is up to a few hundred metres away
from the lat/long used by GPS, but that doesn't much upset this calc.
Also, the world is not spherical, as assumed here. Also, having
assumed it's spherical to get the distances over the ground, I've
immediately assumed it's flat to get the bearing.
If you want to do any of this seriously you really need the iterative
calc referred to above (it's a 'helmert transformation'😉 and then do
transverse mercator projection properly. If that interests you, I'd
recommend obtaining (it used to be a free download) 'a guide to
coordinate systems in Great Britain' from the OS. It's a 40 page
booklet that describes all about datums, transforms and so on, and
includes a worked example of the 'proper' helmert and TM
transformations to go from GPS values to OS grid values. It's quite
interesting, if you like that sort of thing.
regards, Ian SMith
--
|\ /| no .sig
|o o|
|/ \|