Android Question [SOLVED] GPS Library - BearingTo and DistanceTo

JMB

Active Member
Licensed User
Longtime User
Hi there,

Does anyone know if these methods take into account the curvature of the earth?

They don't appear to...

I've been doing bearing and distance checks against waypoints from an aviation database and the distances just don't match.


JMB
 
Last edited:

emexes

Expert
Licensed User
I thought they did. Two easy no-math-required tests:

What bearing do you get if you travel to a different longitude at the same latitude (other than at equator or poles)?

What distance do you get if you travel 90 degrees around equator?
 
Upvote 0

emexes

Expert
Licensed User
If your mismatches are small, it might be that one model is using a spherical earth, and the other a fat earth (technical term escapes me, is something like: oblate sphere?)

Spherical earths also have the issue of: which radius to use?
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
Last edited:
Upvote 0

emexes

Expert
Licensed User
Sorry, got distracted by football. I tested BearingTo and DistanceTo in B4A this afternoon per post #2, and the results I got agree with agraham - calculations are of a spherical-like shape, in that:

1/ Distance of 90 degrees of longitude at the equator is slightly longer than 90 degrees from pole to equator (ie, the earth is flattish!) and both are about 10000 km.

2/ Bearing between two points of same latitude other than equator is not orthagonal, which indicates is not line of constant latitude (rhumb line) and thus is probably great circle, ie shortest distance.
 
Last edited:
Upvote 0

JMB

Active Member
Licensed User
Longtime User
Gentleman, thank you for your posts. Turns out I was using two slightly different databases to confirm the positions.

Very useful to know that it uses the WGS84 ellipsoid.

JMB
 
Upvote 0
Top