I've got the lat/long conversion working without a problem from equations I
downloaded from the net.
I could easily get absolute speed from pythagoras =
sqrt(sqr(x')+sqr(y')+sqr(z')).
What I'm really after however is bearing. I would like to know exactly
which direction the device is traveling, in degrees (0 to 360).
Does anyone have any formulas to work this out ? I've had a good look over
the net and can't find them anywhere.
Thanks
Chris Severn
--
Delete the 'x' to remove the spamblock.
Except spammers, for whom my email address is abuse@localhost
I have them coded up on my HP-48SX mking use of Sparcom's Navigaion
Pac routines.
Also see: http://www.ngs.noaa.gov/TOOLS/XYZ/xyz.html
___________________________________________________________________________
Sam Wormley - http://www.cnde.iastate.edu/staff/swormley/gps/gps_books.html
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----
Northing of 10 mph, and easting of 10 mph: ArcTan (1 ) = 45 degrees
Northing of -10 mph and easting of 10 mph: ArcTan (-1) = -45 degrees, but
the quadrant makes it 180 forward at 135 degrees.
Chris Severn wrote in message <14mje8...@web.wavenet.com.au>...
>Northing of 10 mph, and easting of 10 mph: ArcTan (1 ) = 45 degrees
>Northing of -10 mph and easting of 10 mph: ArcTan (-1) = -45 degrees, but
>the quadrant makes it 180 forward at 135 degrees.
If you have an atan2() function, use that instead of atan(). Atan takes
only one argument, and thus can return a result that's only in the range
+-90 degrees. Atan2() has the signs of both numbers available and returns
a result that's in the range +-180 degrees - with no ambiguity to fix up.
All you have to do is add 360 if the result is negative, to convert
-180 through 0 to 180 through 360, since headings are conventionally
in the range 0-360.
The other detail to watch out for: the normal coordinate system used
by mathematics, and which atan and atan2 are written for, has zero
degrees along the positive X axis and positive rotation is CCW.
The navigator's coordinate system has zero degrees along the positive
Y axis and positive rotation is CW. The two coordinate systems are
just a reflection in the line X=Y relative to each other, so you can
turn one into the other simply by swapping the X and Y coordinates.
So: look up the documentation for your atan2() function - some want
x first and some want Y first. Then, wherever it wants X, give it
delta north, and wherever it wants Y, give it delta east. This is
counterintuitive because you're swapping X and Y.
Dave