... the user friendly GPS tool


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The compass heading between points would be useful at times
#1
Looking at my many GPX files recorded during our last cruise, I note a number of sudden spurts into a completely rediculous heading when I look at the track on the visual map. However finding them in the list is difficult. If the compass heading between point 1 and point 2 were shown, and then the compass heading between point 2 and point 3, continuing to the end, any anomaly would stand out like a soar thumb. If the basic track was 180 degrees south a sudden 239 degrees, followed by a 120 degree heading, and then back to 180 degrees would quickly show me the anomaly, whatever the reason.

How difficult is to add compass heading to the choice of columns in the report? How hard to add that as a choice for calculation? While it makes sense to me and simplifies things for me, even in the city when a sudden distortion in the track due to building reflections occurs, it may be difficult to add, or not make sense to others.

FWIW, I think it would be a good addition for 'fixing' track records after the fact.Smile
Reply
#2
(28.11.2010, 19:49)RsH Wrote: How difficult is to add compass heading to the choice of columns in the report?

Another column is maybe two or three hours of work.

(28.11.2010, 19:49)RsH Wrote: How hard to add that as a choice for calculation?

I don't know of any algorithm that derives a heading from two GPS positions, you?
--
Christian
Reply
#3
(29.11.2010, 18:13)routeconverter Wrote:
(28.11.2010, 19:49)RsH Wrote: How difficult is to add compass heading to the choice of columns in the report?

Another column is maybe two or three hours of work.

(28.11.2010, 19:49)RsH Wrote: How hard to add that as a choice for calculation?

I don't know of any algorithm that derives a heading from two GPS positions, you?

From http://www.movable-type.co.uk/scripts/latlong.html and note that when the two points are a second or two apart from each other, the issues discussed below about the differences in heading as you go greater distances disappear.

Bearing
Baghdad to Osaka Baghdad to Osaka

In general, your current heading will vary as you follow a great circle path (orthodrome); the final heading will differ from the initial heading by varying degrees according to distance and latitude (if you were to go from say 35°N,45°E (Baghdad) to 35°N,135°E (Osaka), you would start on a heading of 60° and end up on a heading of 120°!).

This formula is for the initial bearing (sometimes referred to as forward azimuth) which if followed in a straight line along a great-circle arc will take you from the start point to the end point:

Formula: θ = atan2( sin(Δlong).cos(lat2),
cos(lat1).sin(lat2) − sin(lat1).cos(lat2).cos(Δlong) )


JavaScript:

var y = Math.sin(dLon) * Math.cos(lat2);
var x = Math.cos(lat1)*Math.sin(lat2) -
Math.sin(lat1)*Math.cos(lat2)*Math.cos(dLon);
var brng = Math.atan2(y, x).toDeg();

Excel: =ATAN2(COS(lat1)*SIN(lat2)-SIN(lat1)*COS(lat2)*COS(lon2-lon1),
SIN(lon2-lon1)*COS(lat2))

* Note that Excel reverses the arguments to ATAN2 – see notes below

Since atan2 returns values in the range -π ... +π (that is, -180° ... +180°), to normalise the result to a compass bearing (in the range 0° ... 360°, with -ve values transformed into the range 180° ... 360°), convert to degrees and then use (θ+360) % 360, where % is modulo.

For final bearing, simply take the initial bearing from the end point to the start point and reverse it (using θ = (θ+180) % 360).
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)