Does anyone have an algorithm to determine the direction from one lat/lon to another (pseudo-code):
CalculateHeading( lat1, lon1, lat2, long2 ) returns stri
Convert to a numeric angle and use the result to look up the text. For example, -22.5..+22.5 = N. +22.5..67.5 = NE, 67.5..112.5 = E, etc. Of course, that's assuming you're using only N, NE, E, SE, S, SW, W, NW -- if you decide (for example) to go with the old "32 points of the compass", each text string obviously represents a smaller range.