Re: Latitude / longitude distance and bearing.



Dave (from the UK) wrote:
I have two locations, call them 'a' and 'b' .

a) Altitude of a and b (call them alt_a and alt_b).
b) Latitude of b and b (call them lat_a and lat_b)
c) Longitude of a and b (call them long_a and long_b)


'a' and 'b' are fairly close together (10 - 20 km) and in line of sight distance. (Two mountain peaks).

I want to find

1) The straight line distances from a to b. (*Not* the distance along the circumference of the earth, which I can get from the Haversine formula)


2) The bearing of 'a' when viewed from 'b'.


The Web page you refer to below mentions two kinds of
bearings:

(1) The initial bearing (at 'b') for an arc of a great-circle from 'b'
to 'a'.

(2) The "rhumb line" bearing, where a rhumb line or loxodrome is a path
of constant bearing . The rhumb line route in general is longer than
the arc of great circle route.

Of the two, I think #1 is easier to compute than the "rhumb line" bearing.



3) The vertical angle - i.e how many degress above the horizon is 'a' when viewed from 'b'. (alt_a > alt_b).


So I guess for the horizon you mean the plane perpendicular
to a plumb line ...


If the distances were sufficiently large, the location with the higher altitude could be below the horizon when viewed from the one with lower altitude, but in this case, the distances are small. so the location with the higher altitude is well above the horizon of the location with the lower altitude.

I am willing to assume the earth is spherical. The distances involved are not huge (a few tens of km), and are in Europe (Latitude is North, Longitude is East).

I asked this on 'Dr. Math' and someone suggested I worked in spherical coordinates (rho, theta, phi) then transfered to rectangular.

I've done that and found the points x_a, y_a and z_a using

rho_a=EARTH_RADIUS+alt_a;
theta_a=long_a;
phi_a=M_PI/2.0-lat_a;

Transfered to cartesian coordines

x_a= rho_a*cos(theta_a)*sin(phi_a);
y_a = rho_a*sin(theta_a)*sin(phi_a);
z_a = rho_a*cos(phi_a);

so I get the points x_a, y_a and z_a relative to the point 0,0,0 which is the centre of the earth.

I did likewise for location b, to get x_b, y_b and z_b.

Then I computed

dx=x_a-x_b
dy=y_a-y_b
dz=z_a-z_b


The radial distance between a and b, which is one of the 3 parameters I need, is

r=sqrt(dx*dx + dy*dy + dz*dz);

But I'm stuck as how to find the other two parameters - the bearing the angle above the horizon.

I'm aware of this page:

http://www.movable-type.co.uk/scripts/latlong.html

which has formula for the bearing between two locations, but there is nothing there about altitude, which I suspect might mean the forumula are not valid.


If the altitude values are included, and the
bearing of 'a' when viewed from 'b' is measured as the crow flies or would
fly, I believe the altitudes don't matter and
the initial bearing for an arc of a great-circle from b0 to a0 can be used,
where a0 (resp. b0) has the same latitude/longitude as a (resp. b) but
altitude 0...

For the the elevation, consider the points a, b and O, the center of the
earth. The lengths of the three sides of triangle abO can be computed.
Then I think the elevation, from my assumption about the horizon,
would be the measure of the angle of the triangle at 'b' minus 90 degrees.


David Bernier

.



Relevant Pages

  • Re: Latitude / longitude distance and bearing.
    ... Altitude of a and b. ... (*Not* the distance along the circumference of the earth, which I can get from the Haversine formula) ... The bearing of 'a' when viewed from 'b'. ... The lengths of the three sides of triangle abO can be computed. ...
    (sci.math)
  • Re: Latitude / longitude distance and bearing.
    ... Altitude of a and b. ... (*Not* the distance along the circumference of the earth, which I can get from the Haversine formula) ... The bearing of 'a' when viewed from 'b'. ... The lengths of the three sides of triangle abO can be computed. ...
    (sci.math)
  • Re: Latitude / longitude distance and bearing.
    ... Altitude of a and b. ... (*Not* the distance along the circumference of the earth, which I can get from the Haversine formula) ... The bearing of 'a' when viewed from 'b'. ... The "rhumb line" bearing, where a rhumb line or loxodrome is a path ...
    (sci.math)
  • Re: Any pireps for PCAS MRX collision avoidance system?
    ... bearing information, just altitude and range.. ... I have flown a Ryan 9900B TCAD equipped Seneca, and found the bearing ... Occasionally the Ryan ...
    (rec.aviation.piloting)
  • Re: garmin vista Cx odometer - height taken into account?
    ... arbitrary point some miles away, then set the altitude of the point to ... the same altitude as your own location. ... distant point to a few thousand feet and see if the distance changes. ... Mount Whitney is the highest point in the contiguous United States at ...
    (sci.geo.satellite-nav)