Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Convert from xyz velocities to lat/long speeds and bearing.

1,161 views
Skip to first unread message

Chris Severn

unread,
May 1, 2000, 3:00:00 AM5/1/00
to
I need to convert the x,y,z,x',y',z' information from the raw data of a SiRF
receiver to lat,long,speed and bearing.

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


Sam Wormley

unread,
May 1, 2000, 3:00:00 AM5/1/00
to
See Chapter 4 ,"Terrestrial Coordinates an the Rotation of the
Earth" in the "Explanatory Supplement to the Astronomical
Almanac. The equations are detailed to convert back and forth
from ECEF XYZ to Geodetic (for given ellipsoid parameters).

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! =-----

Tracker

unread,
May 1, 2000, 3:00:00 AM5/1/00
to
ArcTan( Easting/Northing ) and watch your quadrants, gives you your
heading.

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>...

Dave Martindale

unread,
May 1, 2000, 3:00:00 AM5/1/00
to
"Tracker" <nu...@earthlink.net> writes:
>ArcTan( Easting/Northing ) and watch your quadrants, gives you your
>heading.

>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

0 new messages