How inaccurate is it to pretend GPS coordinates are XYZ on a flat plane?

Specifically in finding the angles between two objects.

Does anyone have a fairly accurate (accuracy within ~50 meters) way of converting GPS coordinates + altitude to XYZ?

Basically I'm building an autotracking antenna and I've seen one code example where the programmer used basic trigonometry to figure out where to point. Unfortunately the antenna I'm using needs far greater accuracy than the antenna that code was used for, so I'm trying to determine if that kind of shortcut is still applicable for my situation. And most importantly I'd like to be able to prove it is using math. So even if its very likely it is accurate enough, if anyone has a more accurate method, or knows where I might find one I'd really be thankful.

# GPS Algorithms Question

Page 1 of 1## 6 Replies - 1384 Views - Last Post: 03 July 2012 - 03:37 PM

##
**Replies To:** GPS Algorithms Question

### #2

## Re: GPS Algorithms Question

Posted 02 July 2012 - 08:33 AM

Take a look at using Spherical coordinates.

### #3

## Re: GPS Algorithms Question

Posted 02 July 2012 - 10:39 AM

What is the distance between the two points that you need to measure angles between? Smaller than certain distances, you can ignore the curvature of the Earth and just use XYZ coordinates.

### #4

## Re: GPS Algorithms Question

Posted 03 July 2012 - 07:51 AM

to xyz coordinates? Do you mean cartesian coordinates?

And it's also very inaccurate to "pretend" they are cartesian coordinates. You need to translate them to cartesian from the geographic coordinates. How this is done depends on what your map projection will be...

for instance if your map projection is a globe, well then the catesian coordinates are set around usually the core of the earth being (0,0,0). You should be able to easily convert using a modification of spherical to cartesian coordinate algorithm (some minor rotation, and adjusting the altitude to get the actual distance from the center of the earth... oh and if you go for even more accuracy you may also want to include the fact the earth isn't spherical and is instead ellipsoidal... yeah, you're probably not doing this kind of projection, so move onto the next paragraph).

Where as if you're doing a planar map, well... what is your planar projection? You know how most maps are distorted at the top and bottom (greenland and antartic)... others distorted in other places. Well there's actually a projection matrix that created that planar map, and you should pass your geographic coordinates through it to get new 2d cartesian coords on the plane (x,y), and then you just tack on the altitude for the 3rd making a 3d map: (x,y,alt)

now you may want to ask me, "well what is that projection matrix look like?"... well that's for you to tell me. I have NO IDEA what kind of map projection you're using.

And it's also very inaccurate to "pretend" they are cartesian coordinates. You need to translate them to cartesian from the geographic coordinates. How this is done depends on what your map projection will be...

for instance if your map projection is a globe, well then the catesian coordinates are set around usually the core of the earth being (0,0,0). You should be able to easily convert using a modification of spherical to cartesian coordinate algorithm (some minor rotation, and adjusting the altitude to get the actual distance from the center of the earth... oh and if you go for even more accuracy you may also want to include the fact the earth isn't spherical and is instead ellipsoidal... yeah, you're probably not doing this kind of projection, so move onto the next paragraph).

Where as if you're doing a planar map, well... what is your planar projection? You know how most maps are distorted at the top and bottom (greenland and antartic)... others distorted in other places. Well there's actually a projection matrix that created that planar map, and you should pass your geographic coordinates through it to get new 2d cartesian coords on the plane (x,y), and then you just tack on the altitude for the 3rd making a 3d map: (x,y,alt)

now you may want to ask me, "well what is that projection matrix look like?"... well that's for you to tell me. I have NO IDEA what kind of map projection you're using.

This post has been edited by **lordofduct**: 03 July 2012 - 07:55 AM

### #5

## Re: GPS Algorithms Question

Posted 03 July 2012 - 10:04 AM

That's the term: Cartesian coordinates. I've been bedridden the few days and staring at the spiders outside the window... it should have been a reminder. :-)

The point I was making was if your distances are small enough, you don't need the full precision of spherical coordinates. The pyramids, mayan temples, and Stonehenge were built with planar geometry and they have enough precision for scales that they were built at. (On the other hand, was it the Bay bridge in the Bay area that has ends that missed by a few inches even using modern measuring and surveying tools?)

Yes if your are going to be measuring angles between points where the curvature of the earth starts to matter, then the more accuracy, the better. On the other hand, since you said you are playing with antennas and that angles are critical, then are these antennas essentially line of sight?

The point I was making was if your distances are small enough, you don't need the full precision of spherical coordinates. The pyramids, mayan temples, and Stonehenge were built with planar geometry and they have enough precision for scales that they were built at. (On the other hand, was it the Bay bridge in the Bay area that has ends that missed by a few inches even using modern measuring and surveying tools?)

Yes if your are going to be measuring angles between points where the curvature of the earth starts to matter, then the more accuracy, the better. On the other hand, since you said you are playing with antennas and that angles are critical, then are these antennas essentially line of sight?

This post has been edited by **Skydiver**: 03 July 2012 - 10:05 AM

### #6

## Re: GPS Algorithms Question

Posted 03 July 2012 - 11:17 AM

What is the distance of 1 degree of longitude in feet?

At the equator it's 69.172 miles, shrinking to 0 at the poles.

Even latitude isn't perfect... being 68.703 miles at the equator and 69.407 at the poles.

Furthermore lat/long is not 'spherical coords', they are geographical coordinates. You can slightly modify the spherical algorithm to meet your needs... but it's not the same.

So no, not even in short ranges are they accurate... unless you have stored the longitudal distance for each location on earth for estimation purposes...

Note those temples and the sort were built with planar geometry

So now, if the map is not going to be global. And instead is going to be regional maps. In which case, one can figure out the conversion regionally. You can assume constant latitudal distance for ease (it's close enough) to find the regional longitudal distance. And then just convert from there. Altitude doesn't change.

http://www.movable-t...ts/latlong.html

this might help a bit... That link there will give a basic distance formula that you can use in getting a simple foot hold into the idea of it.... (you'll note that the distance formula uses a modified version of spherical coords... like I referred to being possible before, but not being exactly the same)

At the equator it's 69.172 miles, shrinking to 0 at the poles.

Even latitude isn't perfect... being 68.703 miles at the equator and 69.407 at the poles.

Furthermore lat/long is not 'spherical coords', they are geographical coordinates. You can slightly modify the spherical algorithm to meet your needs... but it's not the same.

So no, not even in short ranges are they accurate... unless you have stored the longitudal distance for each location on earth for estimation purposes...

Note those temples and the sort were built with planar geometry

*in a planar coordinate system*. Geographical coordinates (latitude and longitude) are not planar!So now, if the map is not going to be global. And instead is going to be regional maps. In which case, one can figure out the conversion regionally. You can assume constant latitudal distance for ease (it's close enough) to find the regional longitudal distance. And then just convert from there. Altitude doesn't change.

http://www.movable-t...ts/latlong.html

this might help a bit... That link there will give a basic distance formula that you can use in getting a simple foot hold into the idea of it.... (you'll note that the distance formula uses a modified version of spherical coords... like I referred to being possible before, but not being exactly the same)

This post has been edited by **lordofduct**: 03 July 2012 - 11:31 AM

### #7

## Re: GPS Algorithms Question

Posted 03 July 2012 - 03:37 PM

Good point about approaching the poles!

All my experience with lat/long and angles is from practical experience while orienteering. And all my orienteering experience was all within a 32km square area relatively near the equator so things were almost "square" when it came to measurements.

All my experience with lat/long and angles is from practical experience while orienteering. And all my orienteering experience was all within a 32km square area relatively near the equator so things were almost "square" when it came to measurements.

Page 1 of 1