I wonder if somebody would care to comment on, or "check my logic" on this thinking. Ultimately, if this is correct, i would like to see the Haversine distance be described differently than it usually is, and for somebody to work out better math for a possible elevation correction.
As background, the Haversine formula is a widely accepted method to compute distances over earth, assuming the earth is a sphere, and it does not take into account any peaks or troughs between the points. It is often described as yielding the distance "as the crow flies". This reference is a good one: www.movabletype.co.uk/scripts/latlong.html (and many others can be found with search).
My issue is how to apply the Haversine formula when you have two known elevations for the endpoints. Originally, i assumed that the Haversine distance between the points is simply the "distance over earth, ignoring peaks and troughs" between the points. However, i now believe that actually you need a further calculation, as I'll describe.
Envision the two points as A, on earth at a higher elevation, and B, on earth, at a lower elevation. Now, envision a point C, buried below ground, below A, and at the same elevation as B. Is the Haversine distance, AB, "over earth" (the hypotenuse of a triangle), or is it BC, a distance that goes below the earth (the leg of a triangle)? If it is the leg, you would need to perform an additional computation to get the actual desired overearth distance, AB. That is, is it that the Haversine formula does not give you AB directly? If this is so, i was envisioning it as a right triangle (not of course 100% correct on a sphere, but for the distances i am concerned with, like 10100m, i think it is OK). If it is a right triangle and the Haversine distance is BC (leg), then i could use the Pythagorean theorem to compute AB (hypotenuse). With steeply sloping ground, the difference is nontrivial (25% or more). I stumbled into this when i had lat/long pairs where the slope grade between them is around 80%, and in those cases, the Haversine distance was computed as less than the elevation difference. When i thought that Haversine was giving me AB, this seemed "impossible". But, if Haversine is giving me BC, then AB can be computed as SQRT ( (Haversine)^2) + (Elevation Difference)^2 ). Of course these are arcs, so it is not strictly a triangle, but for my purposes, over short distances, the approximation is probably OK.
So, my questions are: o Do you agree that Haversine is giving me BC and not AB? o Do you agree that the common description of the Haversine distance should be modified to something like "Distance over earth, ignoring peaks and troughs between them, assuming a spherical earth, and when the points are at the same elevation"? o If so, can somebody work out a true spherical trig formula that would be a modification of the Haversine, for "Distance over a spherical earth, ignoring peaks and troughs between them, when the two points are at different and known elevations" (improving upon using Pythagorean theorem)?
Thanks much if you have some time to noodle over this!
Tom
